
package w{ import flash.events.ErrorEvent; import flash.events.IOErrorEvent; import flash.display.Loader; import flash.net.URLLoader; import flash.net.URLRequest; public class ContentDataLoader { private var _loader:Loader; private var _loaderContainer:LoaderContainer;/*It’s a simple mvc I’ve in the stage*/ public function ContentDataLoader(loaderContainer:LoaderContainer) {//trace(’pippo’); _loaderContainer=loaderContainer; _loader=new Loader(); } public function load(contentData:String):void { _loader.addEventListener(IOErrorEvent.IO_ERROR,onError); _loader.load(new URLRequest(contentData)); } private function onError(evt:ErrorEvent):void { trace(“cannot load data file”); } public function get loaderContainer():LoaderContainer { return _loaderContainer; } public function get loader():Loader { return _loader; } } }
Can you help me, please ?
Thanks in advance.
Bye
If you would like to make a comment, please fill out the form below.
Just a little typo. Try this:
private function onError(evt:IOErrorEvent):void {
trace(“cannot load data file”);
}