Return to Snippet

Revision: 5104
at February 22, 2008 02:15 by chrisaiv


Updated Code
var assetLoader:URLLoader = new URLLoader();
    assetLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    assetLoader.addEventListener(Event.COMPLETE, completeHandler);

function progressHandler(e:Event):void
{
	trace(e.currentTarget.bytesLoaded + " / " + e.currentTarget.bytesTotal);
}
function completeHandler(e:Event):void
{
	trace("completeHandler:" + e.currentTarget + " :: " + e.currentTarget.dataFormat + " :: " + 	e.currentTarget.data);
}

Revision: 5103
at February 11, 2008 17:46 by chrisaiv


Initial Code
var assetLoader:URLLoader = new URLLoader();
    assetLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
    assetLoader.addEventListener(Event.COMPLETE, completeHandler);

function progressHandler(e:Event):void
{
	trace(e.currentTarget.bytesLoaded + " / " + e.currentTarget.bytesTotal);
}
function completeHandler(e:Event):void
{
	trace(e.currentTarget.data);
}

Initial URL

                                

Initial Description
URLLoader is not the same as Loader.  It is meant to load text, html, sound, xml, and swf content.  If you want to load an image, use Loader().

Initial Title
AS3: Using URLLoader for Text and XML

Initial Tags

                                

Initial Language
ActionScript 3