
this._urlLoader.load(new URLRequest(“”));
Here’s some more of the code:
protected function initListeners():void { this._urlLoader.addEventListener(Event.COMPLETE, this.onComplete); this._urlLoader.addEventListener(IOErrorEvent.IO_ERROR, this.onError); this._urlLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, this.onError); }
protected function load():void { this._state++; switch( this.state ) { case CONF: this._urlLoader.load(new URLRequest(“config.xml”)); break; case UI: this._urlLoader.load(new URLRequest(“ui.xml”)); break; case CSS: this._urlLoader.load(new URLRequest(“styles.css”)); break; } }
protected function onComplete(e:Event):void { trace(“Shell :: onComplete”); // Does not trace on first call of this._urlLoader.load(); switch( this.state ) { case CONF: DataStatic.data = new XML(URLLoader(e.currentTarget).data); break; case UI: DataStatic.ui = new XML(URLLoader(e.currentTarget).data); break; case CSS: DataStatic.css = new StyleSheet(); DataStatic.css.parseCSS(URLLoader(e.currentTarget).data); break; } load(); } protected function onError(e:ErrorEvent):void { trace(“Shell :: onError : “ + e.text); // Does not trace on first call of this._urlLoader.load(); load(); }
Calling the initial load on the empty URLRequest solves the problem, I’m more just curious as to what the hell is going on.
Oh, I almost forgot. The real kicker of confusion here is that if you notice the onComplete and onError functions both make the next call to load(); Neither statements trace on the first run of load(), but the process doesn’t stop, load() gets called three times.
Is this similar to loader callbacks not being called locally in AS2? At this point I’m royally confused.
Thanks All.
If you would like to make a comment, please fill out the form below.
Recent Comments