?? dataserviceconfig.as
字號:
package com.teknision.net.remote.service
{
import flash.events.Event;
import flash.events.EventDispatcher;
import flash.events.IOErrorEvent;
import flash.net.URLLoader;
import flash.net.URLRequest;
public class DataServiceConfig extends EventDispatcher{
////////////////////////////////////////////////////////////////////////////////////
public var domain:String="";
////////////////////////////////////////////////////////////////////////////////////
private var __loaded:Boolean=false;
private var __loader:URLLoader;
////////////////////////////////////////////////////////////////////////////////////
public var requiresload:Boolean=false;
public function get loaded():Boolean{
var r_val:Boolean=true;
if(!requiresload){
r_val=__loaded;
}
return r_val;
}
////////////////////////////////////////////////////////////////////////////////////
public function DataServiceConfig(){
super();
}
////////////////////////////////////////////////////////////////////////////////////
public function load(i_req:URLRequest):void{
__loader=new URLLoader();
configureLoader(__loader);
__loader.addEventListener(Event.COMPLETE,handleConfigLoad);
__loader.addEventListener(IOErrorEvent.IO_ERROR,handleConfigFailed);
__loader.load(i_req);
}
public function configureLoader(i_loader:URLLoader):void{
//OVERRIDE
}
public function populateFromData(i_data:String):void{
//OVERRIDE
}
////////////////////////////////////////////////////////////////////////////////////
private function handleConfigLoad(event:Event):void{
event.stopPropagation();
populateFromData(__loader.data);
var o_event:Event=new Event(Event.COMPLETE);
dispatchEvent(o_event);
}
private function handleConfigFailed(event:IOErrorEvent):void{
event.stopPropagation();
var o_event:IOErrorEvent=new IOErrorEvent(IOErrorEvent.IO_ERROR);
dispatchEvent(o_event);
}
////////////////////////////////////////////////////////////////////////////////////
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -