Follow Flex After Dark on Twitter

Flex Metadata Tags

Flex Metadata tags...

Common Metadata Tags

Commonly used Metadata tags...

  • Bindable
  • Event
  • Embed
  • Style
  • ...

[Bindable]

The [Bindable] tag declares that an object or property can be the source of binding. As the source of a binding an object will dispatch an event (PropertyChangeEvent) when a watched property's value changes.

   [Bindable]
   public var firstName:String;

Click here to read more about the [Bindable] Metadata tag.

[Event]

The [Event] tag is used to declare Events for...

   [Event(name="colorChange")]

Click here to read more about events.

[Embed]

The [Embed] tag is used to embed external assets into your application.

   [Embed(source="assets/logo.png")]
   public var logo:Class; 

Click here to read more about embedding assets.

[Style]

The [Style] tag is used to declare style properties for...

   [Style(...)]

Click here to read more about styles.

MXML

In MXML metadata tags are declared within a <mx:Metadata> element or within <mx:Script> (e.g. for Bindable properties).

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
   <mx:Metadata>
      [Event("change")]
      [Event("anotherEvent")]
   </mx:Metadata>
   ...
</mx:Application>

ActionScript

In ActionScript metadata tags are declared before the class declaration.

<?xml version="1.0" encoding="utf-8"?>
package some.package
{
   // declare metadata tags outside of the class
   [Event("change")]
   [Event("anotherEvent")]
   
   public class SomeClass
   {
      ...
   }
}

Related Links:

Related Docs
  • ActionScript Bindable ActionScript supports binding via the [Bindable] metadata tag.
  • Flex Styles Styles is Flex are similar to CSS.
  • Flex Binding Flex Data Binding enables objects and their values to be bound together so that when a source changes a target automatically gets updated.
Recent Docs
Random Docs