MXMLコンポーネントでカスタムプロパティを定義するときは、そのプロパティの可能な値のセットを定義して、コード補完関数を呼び出したときにFlex Builderがその時点で表示するようにします(カスタムプロパティの可能な値)。
どのようにそれを行うことができるか考えていますか?
MXMLコンポーネントでカスタムプロパティを定義するときは、そのプロパティの可能な値のセットを定義して、コード補完関数を呼び出したときにFlex Builderがその時点で表示するようにします(カスタムプロパティの可能な値)。
どのようにそれを行うことができるか考えていますか?
[Inspectable]メタタグをenumeration
属性とともに使用します。
メタ
[Inspectable]
データ タグは、コードヒントおよび Flex Builder のプロパティインスペクター領域で公開するコンポーネントの属性に関する情報を定義します。
[Inspectable(defaultValue="abc", enumeration="abc,xyz,pqr")]
public var myProp:Boolean;
私のように、カスタムコンポーネントのMxml部分は次のとおりです。
<com:CustomWindow width="100" height="130" frontImageSrc="{rp.currentItem.path}"
showText="{rp.currentItem.imgtext}" hideImage="{rp.currentItem.noImage}"
buttonMode="true" useHandCursor="true" mouseChildren="true"/>
Actionscript 部分は次のとおりです: -
//Inspectable metadata tag gives you the option in the flex builder
//to choose an option from the available selected options
//Put it with the getter of that particular property
[Inspectable(defaultValue="true", enumeration="true,false")]
public function get showImage():Boolean
{
return _imgVisible;
}
public function set showImage(str:Boolean):void
{
_imgVisible = str;
}