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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章