This code may help you:
package {
public class Names extends MovieClip
{
private var name:String ;
public function Names(name:String)
{
this.name = name ;
this.addEventListener(Event.ENTER_FRAME, doThis);
}
public function doThis(event:Event):void
{
trace(this.name);
}
}
}
All functions, that are called after events being dispatched accept only 1 parameter:Event
.
All you do is just use instance variables
. Good luck, hope it helps :)