Loader : use to load *.swf , all image (jpg,png,gif)
URLLoader : use to load text-doc (xml,txt,php,jsp,asp)
How to use:
Loader:
URLLoader:
URLLoader : use to load text-doc (xml,txt,php,jsp,asp)
How to use:
Loader:
var _ldr:Loader = new Loader();
_ldr.load(new URLRequest('$imagePaph' ));
_ldr.addEventListener(Event.COMPLETE,onURLLoaded);
addChild(_ldr);
function onURLLoaded (event:Event):void{
trace("URLLoader Complete");
}
$imagePath: can be the file path in local or file url in Internet
URLLoader:
var _urlLdr:URLLoader =new URLLoader();
var request:URLRequest = new URLRequest("$docPaph");
_urlLdr.addEventListener(Event.COMPLETE,onURLLoaded);
_urlLdr.load(request)
function onURLLoaded (event:Event):void{
var docData:String=event.target.data;
trace("URLLoader Complete");
}
$docPath: can be the file path in local or file url in Internet
留言