Jump to content
Search Community

Error 2032 Stream Error

kchenry2003 test
Moderator Tag

Recommended Posts

Hi,

I am new to greensock and am trying to follow a tutorial for LoaderMax. The tutorial shows how to use LoaderMax to load XML images. In my file I have 3 images named p1,p2,p3 and the image.xml file is also included. It looks like my code matches the tutorial but I am getting the error:

"Loading error on XMLLoader 'loader0' (xml/images.xml): Error #2032: Stream Error. URL: file:///C|/Users/KLCH/Desktop/New%20Sample%20MAXLoader/xml/images.xml"

 

Any help would be appreciated!!!

 

Here is the code:

import com.greensock.loading.LoaderMax;
import com.greensock.loading.XMLLoader;
import com.greensock.loading.ImageLoader;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.*;
import com.greensock.TweenLite;
import flash.display.Sprite;
import com.greensock.loading.display.ContentDisplay;
import flash.events.MouseEvent;
import flash.display.DisplayObject;

var imageContainer:Sprite = new Sprite();
addChildAt(imageContainer, 0);

LoaderMax.activate([xmlLoader,ImageLoader]);
var loader:XMLLoader = LoaderMax.parse("xml/images.xml");



loader.addEventListener(LoaderEvent.PROGRESS, LOADProgress);

loader.addEventListener(LoaderEvent.PROGRESS, LOADComplete);

b0.addEventListener(MouseEvent.CLICK, buttonClick);
b1.addEventListener(MouseEvent.CLICK, buttonClick);
b2.addEventListener(MouseEvent.CLICK, buttonClick);

function LOADProgress(e:LoaderEvent):void
{
preloader_txt.text = Math.round(e.target.progress * 100) + "%";
}
function LOADComplete(e:LoaderEvent):void
{
preloader_txt.visible = false;
var queue:LoaderMax = LoaderMax.getLoader("loader") as LoaderMax;
for (var i:Number = 0; i < queue.content.length; i++)
{
	var image:ContentDisplay = queue.content[i];
	imageContainer.addChild(image);
	image.alpha = 0;
}
showImage(0);
}
function showImage(index:Number):void
{
for (var i:Number = 0; i< imageContainer.numChildren; i++)
{
	var child:DisplayObject = imageContainer.getChildAt(i);
	if (child.alpha > 0)
	{
		TweenLite.to(child, .5, {alpha:1});
	}
}
TweenLite.to(imageContainer.getChildAt(index), .5, {alpha:1});
}
function buttonClick(e:MouseEvent):void
{
var num:Number = Number(e.currentTarget.name.substr(1));
showImage(num);
}
loader.load();

Link to comment
Share on other sites

are you absolutely certain that images.xml is inside a folder named "xml" ?

 

if you want to zip your New Sample MaxLoader directory and post it here, we can look at it, but from the error it seems to be that the xml file can't be found and its not really a coding error (other than having the wrong path to the xml file).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...