使用场景
为心爱的小车车模拟贴图、纹上签名等
源文件下载(adobe animate打开):https://pan.baidu.com/s/1CN-SVwcF60YlV7ZrJUnidw?pwd=havs
提取码:havs
贴一段熟悉又陌生的代码回忆一下
[Asm] 纯文本查看 复制代码 package flash023
{
import flash.events.IEventDispatcher;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
/**
* ...
* [url=home.php?mod=space&uid=686208]@AuThor[/url] FLASH023
*/
public class XMLLoader {
private var loader:URLLoader;
private var completeHandler:Function;
public function XMLLoader(url:String,_fun:Function):void {
completeHandler=_fun;
loader=new URLLoader();
loader.load(new URLRequest(url));
loader.addEventListener(Event.COMPLETE, loaderComplete);
}
private function loaderComplete(_evt:Event) {
completeHandler(XML(_evt.target.data));
}
}
}
|