Reputation: 3
I want to pass Event.type
in a variable to EventDispatcher
like this:
public var e:String = "Event.ENTER_FRAME";
addEventListener(e, moveBox);
Instead of:
addEventListener(event.ENTER_FRAME, moveBox);
It is compiling okay but while running the Event
is not dispatching. Is there anything I am doing wrong, please help.
Thanks in advance
Upvotes: 0
Views: 54
Reputation: 2223
Don't do this:
public var e:String = "Event.ENTER_FRAME";
do this:
public var e:String = Event.ENTER_FRAME;
Upvotes: 1