have you tried defining your listening function before your loadText function ? Had similar problems when defining the event handlers after the load() call. Also you could use LoadVars to test the existence of the file firsthand.
import mx.utils.Delegate; var fileExists:Boolean = false; var testFile:LoadVars = new LoadVars(); testFile.onLoad = Delegate.create(this, testExist); function testExist(success:Boolean) { fileExists = success; } testFile.load(pPath + "texts.swf"); Then load either the swf or the xml accordingly. HTH Alain -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Danny Kodicek Sent: 31 janvier 2007 11:16 To: 'Flashcoders mailing list' Subject: [Flashcoders] onLoadInit running when swf doesn't exist I've got some information that might either be contained in a swf file or an xml file. What I'm doing (stripped down) is this: function loadText():Void { var tSwf:String = pPath + "texts.swf"; var tContainer:MovieClip = this.createEmptyMovieClip("txt", this.getNextHighestDepth()); var tLoader:MovieClipLoader = new MovieClipLoader(); tLoader.addListener(this); tLoader.loadClip(tSwf, tContainer); } function onLoadError(tContainer:MovieClip):Void { tContainer.removeMovieClip(); importText(pPath + "texts.xml"); } function onLoadInit(tContainer:MovieClip):Void { <stuff here> } So it tries to load in the .swf, and if this isn't found, it looks for the XML. Running locally, this is working fine. But running online, it's failing: despite the fact that the swf file doesn't exist, it's running onLoadInit instead of onLoadError. Anyone have any thoughts? Danny _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.1.410 / Virus Database: 268.17.17/661 - Release Date: 2007-01-30 -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.410 / Virus Database: 268.17.17/661 - Release Date: 2007-01-30 _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com