Flex Metadata tags

http://livedocs.adobe.com/flex/3/html/help.html?content=metadata_3.html

MetaData 标签:Metadata tags provide information to the Flex compiler that describes how your components are used in a Flex application.

ArrayElementType

[ArrayElementType]

语法:[ArrayElementType("Type")]

参数 Type:申明一个指定数据类型的数组变量。数据类型可以是 String, Number, class, or interface.如果是自定的数据类型,需要指定完整的包名及类名。

示例:[ArrayElementType("String")] public var ary:Array;

Bindable

如果属性的数据源是一个数据绑定表达式,当这个源属性的值发生改变时,Flex会自动拷贝源属性的值到任何目标属性.信号到Flex进行执行复制,你必须用[Bindable]元数据标签与Flex的属性进行注册,并且源属性值发生变化时必段派发一个事件.

When a property is the source of a data binding expression, Flex automatically copies the value of the source property to any destination property when the source property changes. To signal to Flex to perform the copy, you must use the [Bindable] metadata tag to register the property with Flex, and the source property must dispatch an event.

语法: 

变量绑定:[Bindable]  private var strValue:String;

事件绑定:[Bindable(event="eventname")]


使用可绑定的属性链

当你指定一个属性做为数据绑定的源,Flex不仅监控属性的改变,也监控“chain of properties leading up to it”,整个链的属性,包括目标属性,称为一个可绑定的属性链,在下面的例子中,firstName.txt是一个可绑定的属性链,包括firstName对象和它的text属性。

<first>{firstName.text}</first>

DefaultProperty

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")]

发布了42 篇原创文章 · 获赞 8 · 访问量 6万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章