flex动态加载swf皮肤示例代码(flash动态效果)太疯狂了

随心笔谈9个月前发布 admin
76 0

xmlns:s=”library://ns.adobe.com/flex/spark”

xmlns:mx=”library://ns.adobe.com/flex/mx” minWidth=”955″ minHeight=”600″

creationComplete=”initHandler(event)”>

import flash.utils.clearTimeout;

import flash.utils.setTimeout;

import mx.events.FlexEvent;

private var styleurl:String=””;

private var setTimeout2:uint;

protected function initHandler(event:FlexEvent):void

{

styleurl=”style01.swf”;

styleManager.loadStyleDeclarations(styleurl,true);

}

protected function t1_clickHandler(event:MouseEvent):void

{

if(styleurl!=null)

{

styleManager.unloadStyleDeclarations(styleurl,true);

}

styleManager.loadStyleDeclarations(“style02.swf”,true);

styleurl=”style02.swf”;

}

protected function button1_clickHandler(event:MouseEvent):void

{

setTimeout2=setTimeout(button1_click,2000);

}

private function button1_click():void

{

if(styleurl!=null)

{

styleManager.unloadStyleDeclarations(styleurl,true);

}

styleManager.loadStyleDeclarations(“style03.swf”,true);

styleurl=”style03.swf”;

clearTimeout(setTimeout2);

}

protected function button2_clickHandler(event:MouseEvent):void

{

// TODO Auto-generated method stub

if(styleurl!=null)

{

styleManager.unloadStyleDeclarations(styleurl,true);

}

styleManager.loadStyleDeclarations(“style01.swf”,true);

styleurl=”style01.swf”;

}

]]>

© 版权声明

相关文章