- <?xml version="1.0" encoding="utf-8"?>
- <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
- width="100" height="16" >
- <mx:LinkButton width="16" height="16" color="#ff0000" icon="@Embed('assets/png/springbt.png')"
- click="onChangeStyle(event)" x="0" id="spring" toolTip="春季主题"/>
- <mx:LinkButton width="16" height="16" color="#ff0000" icon="@Embed('assets/png/summerbt.png')"
- click="onChangeStyle(event)" x="17" id="summer" toolTip="夏季主题"/>
- <mx:LinkButton width="16" height="16" color="#00ff00" icon="@Embed('assets/png/autumnbt.png')"
- click="onChangeStyle(event)" x="34" id="autumn" toolTip="秋季主题"/>
- <mx:LinkButton width="16" height="16" color="#ff0000" icon="@Embed('assets/png/winterbt.png')"
- click="onChangeStyle(event)" x="51" id="winter" toolTip="冬季主题"/>
- <mx:LinkButton width="16" height="16" color="#ff0000" icon="@Embed('assets/png/default.PNG')"
- click="onChangeStyle(event)" x="68" id="defult" toolTip="默认主题"/>
- <mx:Script>
- <![CDATA[
- import com.yyhy.webgis.model.ModelLocator;
- private var __model:ModelLocator = ModelLocator.getInstance();
- private function onChangeStyle(event:MouseEvent):void
- {
- if(event.currentTarget == spring)
- {
- __model.selectskin = "Spring";
- StyleManager.loadStyleDeclarations("assets/skins/color/Spring.swf");
- }
- else if(event.currentTarget == summer)
- {
- __model.selectskin = "Summer";
- StyleManager.loadStyleDeclarations("assets/skins/color/summer.swf");
- }
- else if(event.currentTarget == autumn)
- {
- __model.selectskin = "Autumn";
- StyleManager.loadStyleDeclarations("assets/skins/color/autumn.swf");
- }
- else if(event.currentTarget == winter)
- {
- __model.selectskin = "Winter";
- StyleManager.loadStyleDeclarations("assets/skins/color/winter.swf");
- }
- else if(event.currentTarget == defult)
- {
- __model.selectskin = "Start";
- StyleManager.loadStyleDeclarations("assets/skins/color/start.swf");
- }
- else
- {
- __model.selectskin = null;
- return;
- }
- }
- ]]>
- </mx:Script>
- </mx:Canvas>