首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 媒体动画 > flex >

Flex States 施用

2013-08-10 
Flex States 应用?xml version1.0 encodingutf-8?s:Application xmlns:fxhttp://ns.adobe.com/

Flex States 应用
<?xml version="1.0" encoding="utf-8"?><s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" frameRate="2" minWidth="955" minHeight="600" xmlns:state="com.view.state.*"><s:layout><s:VerticalLayout/></s:layout><state:StateThree id="two"/></s:Application>

?StateThree:

<?xml version="1.0" encoding="utf-8"?><state:StateOne xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" name="stateThree"xmlns:state="com.view.state.*" width="400" height="300"><!--这里是个测试,我在StateOne中定义了一个set 的test 方法,在子类StateThree中,你可以以XML形式的形式对它进行赋值。所以不要看是否是XML定义的就能否继承,而是看它是xml组件还是xml形式的方法。方法当然可以继承。--><state:test><fx:Object a="b"/><fx:Object a="d"/><fx:Object a="e"/></state:test><!--对于子类来说,如果你也定义了States,就相当于重写了父类的方法,所以就不会再继承父类的States定义了--><s:Label text="three"/></state:StateOne>

?StateOne:

<?xml version="1.0" encoding="utf-8"?><s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"  xmlns:s="library://ns.adobe.com/flex/spark"  xmlns:mx="library://ns.adobe.com/flex/mx"  name="stateOne" width="400" height="300" currentState="normal"><fx:Script><![CDATA[import mx.events.FlexEvent;public function set test(array:Array):void{for each(var item:Object in array){trace("item.a=" + item.a);}}]]></fx:Script><s:states><s:State name="normal"/><s:State name="min"/></s:states><s:layout><s:VerticalLayout/></s:layout><s:Label text="normal" includeIn="normal"/><s:Label text="min" includeIn="min"/></s:Group>

?

?

?

热点排行