2011-09-20 63 views
2

我正在使用Adobe Air创建移动应用程序。我想动态添加一个容器或组,其中可以包含一些元素,并具有边框和背景色。由于这些是动态添加的,因此我使用Actionscript 3. bordercontainer可以正常工作,但根据:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/BorderContainer.html此组件不适用于移动设备。Actionscript3,Adobe Air for mobile:替代bordercontainer?

所以我的queston是:什么样的轻量级组件可以包含其他元素,并且具有可设置的背景颜色和边框?

回答

1

只需使用组spark组件。你会添加一个矩形与填充背景和实线:

<s:Group> 
    <s:Rect> 
    <s:stroke> 
     <s:SolidColorStroke /> 
    </s:stroke> 
    <s:fill> 
     <s:SolidColor /> 
    </s:fill> 
    </s:Rect> 
</s:Group> 

支付额外的性能提升,你可能想看看FXG预编译。关于那个here的一些文章。