-
Notifications
You must be signed in to change notification settings - Fork 11
Description
It might be some bug, but sometimes AssetQueue just freezing and doesn't call the "Complete" function(but all files were completely loaded). And if i just restart my app AssetManager just working properly again. There are no errors in console... I'm loading a few ATF and PNG files. What it might be?
Code:
private function LoadAssets():void{
AssetMan = AssetManager.getInstance();
AssetMan.addEventListener(AssetEvent.QUEUE_START, onQueueStarted, false, 0, true);
AssetMan.addEventListener(AssetEvent.QUEUE_COMPLETE, onQueueComplete, false, 0, true);
// Add assets to load
for(var j:int = 0; j<CARDSDATA.card.length();j++){
AssetMan.add("base/" + dev_suffix + "/" + CARDSDATA.card[j].attribute("pic"));
}
AssetMan.add("base/" + dev_suffix + "/icons.png");
AssetMan.add("base/" + dev_suffix + "/ui.atf");
AssetMan.add("base/" + dev_suffix + "/mainback.atf");
function onQueueStarted(e:AssetEvent):void{Console.type("Queue started:" + e.target,Console.COMMENT_FLAG);}
function onQueueComplete(e:AssetEvent):void{
//FOLLOWING CODE DOESN"T CALLED SOMETIMES...WHY?
Console.type("---------------------------");
Console.type("Master asset queue complete");
Console.type("---------------------------");
AssetMan.removeEventListener(AssetEvent.QUEUE_COMPLETE, onQueueComplete);
}//END OF onQueueComplete
}