My favorites | Sign in
Project Logo
                
Search
for
Updated Oct 29, 2008 by dono...@hydrotik.com
QueueLoader  
QueueLoader intro

Introduction

QueueLoader 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.


Comment by bivald, Mar 19, 2008

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:

- http://code.google.com/p/queueloader-as3/ change to QUEUE_COMPLETE and ITEM_COMPLETE. - On this page, Load Monitoring, "function onItemInit" should be "function onItemComplete"

Great work with the loader!

Comment by chichilatte, Jul 18, 2008

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 "});

Comment by chichilatte, Jul 18, 2008

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...

Constructing MySwfsDocumentClass
Constructing MySwfsDocumentClass

Am I being stupid? Is there a way to have the class instantiated only once?

Comment by francesco.carteni, Jul 29, 2008

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

event.file.play();

into the handler because generated an error.

Comment by haungo, Sep 09, 2008

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!

Comment by bdefore, Apr 20, 2009

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.

at com.hydrotik.queueloader::QueueLoader/com.hydrotik.queueloader:QueueLoader::loadNextItem() at com.hydrotik.queueloader::QueueLoader/execute() at QLTest$iinit()


Sign in to add a comment
Hosted by Google Code