One of the first thing AS2 developers will notice when coding in AS3 is that “onPress” and “onRelease” and others symbol’s events are all deprecated. Now all those events are called by listeners as shown below.



On this post I’ll give an important tip: how to pass parameters to event listeners in AS3. See the code below:



It’s the same listener now passing two parameters to the “traceNameAge” function.

Of course this example isn’t the best usage of passing parameters to event listeners. It’s a didactic example only.

Download the source code here.


Tags: