Flash video tutorials

Free Utilities

Events Scroller | Images Scroller | Multi FLV Player | Flash CS3 GuestBook | News Scroller | Tortillas - creator of simple graphs for statistical data | 3D images visualization free utility | Flash CS3 Uploader - free utility | Mini Gallery | Flash CS3 puzzle | Hit counter Flash CS3 + XML + PHP | Multi Audio Player | Newsletter module | Bluring Slide | Monthly Calendar | ShoutBox | StripGallery - Flash CS3 and XML gallery | Email Form PRO | MaskMenu | Elastic Gallery | PhotoNavigator | Pixellation - SlideShow | Email form | Analogue clock | FullScreen images gallery | Rotating header | Flash Portfolio | Polls System | Products Exhibitor | Mini Navigator | Drag Menu | Horizontal Menu | Quizzer | Mini Navigator 2 | Reflect Gallery | Events Scroller - version 2 | Rotating header 2 | Magnifying Glass | Zoomify | MenuVibration | Email form Flash CS3 and ColdFusion 8 | News Scroller 2 | Simple GuestBook | Captcha for Flash CS3 | Email form with pictures - Flash CS3 and PHP | FlepCharCode | Mac Menu | Header | Memory Game - Flash CS3 game | Flash CS3 CountDown | FLV Slide Show Videos | Illusion - images gallery | Tell A Friend | terms of use | Flash RSS reader | ToolTip Flash CS3 - CS4 | Sliding Email Form | ComboMenuHeader | ComboMenuHeader PRO | Mac Front Row in Flash CS3 | FlaTwit - Flash and Twitter - twit this | Store Locator | Multi Video Player MAC style | hittest and magnifying glass | Flash XML editor | BlurSlideShow | ImagesViewer | Video Gallery | Flash XML editor gallery 1 | 15 numbers game | Tipper vertical scroller with Iphone effect | YouTube Video Player by categories | GuestBook Flash CS4 | tweened menu | Twitter RSS reader | Xmas Flash header | Events Scroller - version 3 | TripleBox | BlackComboBox | Inertial Photo Portfolio | Fullscreen Background | Multi Categories Images Gallery |

describeType method with custom events

by admin on October 19, 2009 · 0 comments

in Sintax

We saw long ago how to create custom events.

In this tutorial we explore custom events and the method describeType of Actionscript 3.0 utils package.
This method wants an object as a parameter and returns an XML format with the full description of the object except for the static properties.
In can check the XML format output that shows the method describeType at the following URL:

describeType Actionscript 3.0

In this tutorial we are dispatching two types of events ( Timer and Object) and then the class that is listening for these events will use the method describeType to retrieve the data type of the event and so according to the separate actions to be taken.

This tutorial is expanded in this way:

  • A main.fla file where there is an instance of a ComboBox and TextArea.
  • The Document Class (Main.as) that populates the ComboBox and dispatching custom events.
  • A class called CustomEvents that extends the Event class and that, as the name implies, contains static constants that are nothing more than custom events names.
  • A class called MyDispatcher extending the EventDispatcher class.
  • A class called DrawingClip that listens for events that implements an instance of MyDispatcher and that property is listening the events dispatched by the Document Class (Main.as). Depending on the type of event, DrawingClip perform actions.

In practice:

  1. We need a class that extends Event that serves as "warehouse" containing the names of custom events (CustomEvents.as).
  2. Then another class that simply extends EventDispatcher (MyDispatcher) which the created instance of that class should be in the class that will listen for events and then perform the actions (in our case is DrawingClip).
  3. About dispatching events? In this case the Document Class (Main.as) dispatches them by taking from CustomEvents.as. Such as when we dispatch the MouseEvent.MOUSE_DOWN event that we take the name from the MouseEvent class.

Let’s see the example to better understand.

Read more…

Share This Post

Related posts

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Older post:

Newer post: