4

I've seen the embed tag used before the class definition, but I just saw that Keith is using these..

[Event(name="select", type="flash.events.Event")]
[Event(name="close", type="flash.events.Event")]
[Event(name="resize", type="flash.events.Event")]
public class Window extends Component{

can someone tell me what this does?

Daniel
  • 34,125
  • 17
  • 102
  • 150

1 Answers1

9

Most importantantly, the Flex compiler uses it when interpreting MXML. But really its just metadata, ASDocs & some code completion implementations will use it to show you the available events, but thats about it.

Its in the docs here: http://livedocs.adobe.com/flex/3/html/help.html?content=createevents_3.html

Hope that helps!

(answer edited to be more accurate)

Tyler Egeto
  • 5,505
  • 3
  • 21
  • 29
  • lol ya it is, the best thing to do when searching for those it to add "metadata" to the search query. – Tyler Egeto Apr 12 '11 at 03:49
  • 4
    You can make your own meta data as well if you want. E.g. you can have metadata like `[Divillysausages(someVar="value")]`. You'll need to specify `-keep-as3-metadata+=Divillysausages` in your project compiler settings, and you can access it through the `describeType()` function – divillysausages Apr 12 '11 at 08:32