DispatchEvent :How to use it?


In some cases dispatchEvent expression can be very useful.  For example; you can communicate with other classes that you ceated by dispatchEvent.  Basically I created a class and put a tween function. When tween finishes, my class dispatches as “TweenFinished”. In main fla file I added an EventListener to instance name of the class. Usually I have missed that part so my dispatcher doesn’t work as I expected.

EventListener listens to  “TweenFinished”. When it gets this message, ball moves to center of the stage.  So my main class is;

click here to download source.

Leave a Reply

Your email address will not be published. Required fields are marked *