I have this class:
public class LogoManager extends Sprite{
function LogoManager(x){
var loader:Loader = new Loader();
function loaded(evt:Event){
trace('worked');
addChild(evt.target.content);
}
function failed(evt){
trace('failed');
}
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaded);
loader.contentLoaderInfo.addEventListener('ioError', failed);
loader.load(new URLRequest(x+'.swf'));
}
}
Periodically, it fails to load the swf, which is weird because the swf is a local file. If it fails, it doesn’t call the failed function, or the loaded function.
Does anyone know why it would work sometimes and not others? Is it just a bug that happens when I run it locally? Will it still break o the server? Is there a good way to check for and handle it – maybe a different error message it is throwing, or some way to retry after X seconds?