|
QueueLoader
QueueLoader intro
IntroductionQueueLoader is an open source linear asset loading tool with progress monitoring. It's largely used to load a sequence of images or a set of external assets in one step. Please contact me if you make updates or enhancements to this file. If you use QueueLoader, I'd love to hear about it. Special thanks to Felix Raab for the original AS2 version! Please contact me if you find any errors or bugs in the class or documentation or if you would like to contribute. |
Sign in to add a comment
Note that QUEUE_INIT and ITEM_INIT changed in Rev 18. But in the first example (here on the wiki and on the main site) the old function names is used, partial or in full. Not a major problem, but it might be confusing for beginners.
Suggested edits:
Great work with the loader!
Your Basic Loading example has a syntax error... oLoader.addItem("images/image1.jpg"), img, {title:"Image "});
shuld be
oLoader.addItem("images/image1.jpg", img, {title:"Image "});
I was wondering how you might use QueueLoader to load a swf which has its own document class. From the examples given on this page, it looks like the document class will be constructed twice. Eg.
var _oLoader:QueueLoader = new QueueLoader(); var swf = new MySwfDocumentClass(); addChild(swf); _oLoader.addItem("myswf.swf"), swf, {title:"My SWF"}); _oLoader.execute();and the document class:
package { public class MySwfDocumentClass extends MovieClip { public function MySwfDocumentClass() { trace("Constructing MySwfsDocumentClass"); } } }will result in the output...
Am I being stupid? Is there a way to have the class instantiated only once?
Hi, i tried the 'Loading FLV into a VideoPlayer? object' but doesnt't run.
My version is:
import com.hydrotik.utils.QueueLoader; import com.hydrotik.utils.QueueLoaderEvent; import fl.video.VideoPlayer; var _oLoader:QueueLoader = new QueueLoader(); var flvContainer:VideoPlayer = new VideoPlayer(); addChild(flvContainer); _oLoader.addItem("000004529091_HDFlashVideo.flv", flvContainer, {title:"flv"}); _oLoader.execute(); _oLoader.addEventListener(QueueLoaderEvent.ITEM_COMPLETE, onItemComplete,false, 0, true); // event.file:NetStream function onItemComplete(event:QueueLoaderEvent):void { trace("\t>> FLV: "+event.type, "item title: "+event.title); if(event.filetype == QueueLoader.FILE_FLV) { trace(event.file) } }In this version i've just created a VideoPlayer? instance and i've cut
into the handler because generated an error.
Can you preload the stage + timeline in the same queue with an xml file an all the images from that xml file? That sure would be great!
Note that if you are requesting an XML file from a data service that does not have the XML extension, at this point you must pass {mimeType:QueueLoader.FILE_XML} in with the third parameter for your addItem calls. Otherwise you get this rather obscure error upon calling execute:
TypeError?: Error #1010: A term is undefined and has no properties.