<?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600" creationComplete="init();" > <mx:Script> <![CDATA[ private function init():void { StyleManager.loadStyleDeclarations('style1CSS.swf'); } ]]> </mx:Script> <mx:ComboBox id = "styleCombo" top="10" left="10" right="10" dataProvider="['style1CSS', 'style2CSS', 'style3CSS']" change="StyleManager.loadStyleDeclarations(styleCombo.selectedItem + '.swf')" /> </mx:Application>
style1CSS.css定义了Application容器的背景色与背景图:
Application { backgroundImage: Embed(source="assets/backgrounds.swf#bluestripe"); themeColor: #009999; }
style2CSS.css为:
Application { backgroundImage: Embed(source="assets/brushedmetal.jpg"); themeColor: #0033cc; }
style3CSs.css为:
Application { backgroundImage: Embed(source="assets/backgrounds.swf#retroFifties"); themeColor: #ff9900; }
运行的效果图:
实例与资源请到这个地址下载自行测试:www.idceye.com/blog/post/281/