stevewoolcock / assetmanager Goto Github PK
View Code? Open in Web Editor NEWAsset management for ActionScript 3.0
Asset management for ActionScript 3.0
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
}
I know this isn't strictly a problem with the code, but I noticed that for some reason Flash Builder 4.6 doesn't like the whitespace on line 364 of AssetQueue.as:
args ||= { };
Code thereafter is peppered with warnings and code-completion/type-checking doesn't work. I removed the space between the braces and all is well again. Odd I know, but other Flex devs may also experience this.
Nice manager! But how it can remove unused assets when they aren't already needed? Can't find that in doc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.