开发者

Setting property of Object in Flex

开发者 https://www.devze.com 2023-01-28 05:45 出处:网络
<mx:Canvas id=\"maincanvas\" backgroundColor=\"7000\" width=\"100%\" height=\"100%\"> <mx:TextAr开发者_运维知识库ea backgroundAlpha=\"0\"/>
<mx:Canvas id="maincanvas" backgroundColor="7000" width="100%" height="100%">
    <mx:TextAr开发者_运维知识库ea backgroundAlpha="0"/>
</mx:Canvas>

However if I try creating a new textarea object via:

var textarea:TextArea = new TextArea ();
textarea.backgroundAlpha = 0;
maincanvas.addChild(textarea);

flex throws the error :

1119: Access of possibly undefined property backgroundAlpha through a reference with static type mx.controls:TextArea.


backgroundAlpha is a style, so you've got to set it with:

textarea.setStyle("backgroundAlpha", 0);
0

精彩评论

暂无评论...
验证码 换一张
取 消