Using Your Own Custom Metadata in AS3

Jacob Wright
March 15th, 2008

Flex 3 gives us a great new feature, custom metadata tags. Now, I know you could actually use custom metadata in Flex 2, but you would have to add "-keep-as3-metadata MyTag" to every single project that utilized these custom tags. In Flex 3, if you add "-keep-as3-metadata MyTag" to a library (using compc to compile a SWC or a Flex Builder Library project), then EVERY project that uses that SWC will automatically keep the "MyTag" metadata tags. This allows custom libraries that utilize these tags for development.

Would be cool to create a library to hook up listeners so you can create listeners like this:

[Listen(obj="this.closeButton", event="click")]
public function closeClickHandler(event:MouseEvent) {...}

You'd use -keep-as3-metadata Listen in the libraries compiler options. Maybe if you want I could post a tutorial on doing something like this. Drop me note and let me know if there is interest.

2 Responses to “Using Your Own Custom Metadata in AS3”

  1. edison Says:

    i really want to know how to define metadata tags and how to use them. it’s better to provide me a tutorial.
    thanks a lot~

  2. Alvaro Says:

    Hi, nice blog, will be cool if you publish this tutorial

Leave a Reply