Macromedia flex 2 Manual

Page of 254
Metadata tags
55
The following example uses a static constant as the source for a data-binding expression:
<?xml version="1.0"?>
<!-- metadata/StaticBinding.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
      <![CDATA[
        // This syntax casues a compiler error.
        // [Bindable]
        // public static var varString:String="A static var.";
        public static const constString:String="A static const.";
      ]]>
    </mx:Script>
    <!-- This binding occurs once at application startup. -->
    <mx:Button label="{constString}"/>    
</mx:Application>
DefaultProperty metadata tag
The 
[DefaultProperty]
 metadata tag defines the name of the default property of the 
component when you use the component in an MXML file.
The 
[DefaultProperty]
 metadata tag has the following syntax:
[DefaultProperty("propertyName")]
The 
propertyName
 property specifies the name of the default property.
You can use the 
[DefaultProperty]
 metadata tag in your ActionScript component to define 
a single default property. For more information, and an example, see 
Effect metadata tag
The 
[Effect]
 metadata tag defines the name of the MXML property that you use to assign 
an effect to a component and the event that triggers the effect. If you define a custom effect, 
you can use the 
[Effect]
 metadata tag to specify that property to the Flex compiler.
For more information on defining custom effects, see 
An effect is paired with a trigger that invokes the effect. A trigger is an event, such as a mouse 
click on a component, a component getting focus, or a component becoming visible. An effect 
is a visible or audible change to the component that occurs over a period of time.