05.24Tutorial - addEventListener code completion in Flash Develop
Hi Everyone,
in one of the recent releases of FlashDevelop they added a wonderful feature which lets you see what events are dispatched by the objects you are using. This is done through some meta tags inside of the class declaration and the result is very valuable. It looks like this:

The meta tags are simple as you can see here:
Actionscript:
-
/**
-
* [broadcast event] Dispatched 4 times as second to update the listeners.
-
* @eventType newcommerce.media.MediaTimeEvent.TIME
-
*/
-
[Event(name="media_time",type="newcommerce.media.MediaTimeEvent")]
- The
@eventTyperefers to the complete package + class + const that is used to represent the event type. - The
nameis the constant's value, in this case the value ofMediaTimeEvent.TIME - The
typeis the package + class of the event being dispatched
You insert them in the class which dispatches the events, like so:
Actionscript:
-
public class FLVPlayer extends EventDispatcher
-
{
-
/**
-
* [broadcast event] Dispatcher when a thumb is selected.
-
* @eventType newcommerce.media.MediaEvent.FINISHED_PLAYING
-
*/
-
[Event(name="finished_playing",type="newcommerce.media.MediaEvent")]
-
-
/**
-
* [broadcast event] Dispatcher when a thumb is selected.
-
* @eventType newcommerce.media.MediaEvent.STARTED_PLAYING
-
*/
-
[Event(name="started_playing",type="newcommerce.media.MediaEvent")]
-
-
protected var _currentMedia:MediaData;
-
protected var _stream:NetStream;
-
-
/* .... */
If want some sample code, you can download the update source of the FLVPlayer classes here.
That's it folks!

[...] and other transitions via ActionScript code for Flash. $fx() - JavaScript Animation Library $fx 05.24Tutorial - addEventListener code completion in Flash Develop - blog.martinlegris.com 05/25/2009 Hi Everyone,in one of the recent releases of FlashDevelop they [...]
May 25th, 2009 at 6:56 pm