Jump to content
Search Community

[Help] Error #2099

kopies test
Moderator Tag

Recommended Posts

Hi,

 

I am newbie, just first time using this. I want to ask. I get trouble with LoaderMax. I'm using queue Loader and SWF Loader to load my asset.

 

 

import com.greensock.*;
import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;

import flash.display.Sprite;
import flash.display.MovieClip;


var _progressDisplay:ProgressCircleLite;
LoaderMax.activate([imageLoader, SWFLoader, VideoLoader]);
var urls:Array = [
"informasi/informasi.jpg",
"informasi/studio1.jpg",
"informasi/studio2.jpg",
"informasi/studio3.jpg",
"informasi/studio4.jpg",
"informasi/studio5.jpg",
...
up to 100 pict
...

"galeri6/gallery_1/Images00008.jpg",
"galeri6/gallery_1/Images00008.jpg",
"galeri6/gallery_1/Images000010.jpg"];

var queue:LoaderMax = LoaderMax.parse(urls, {name:"mainQueue",onComplete:completeHandler, onprogress:progressHandler, onerror:errorHandler}, {autoPlay:true});
queue.append( new SWFLoader("mainMovie.swf", {name:"childClip", estimatedBytes:3000, container:this, autoPlay:true}) );



LoaderMax.prioritize("mainQueue");
queue.load();

_progressDisplay = new ProgressCircleLite({radius:26, thickness:4, trackColor:0xFFFFFF, trackAlpha:0.25, trackThickness:4, autoTransition:false, smoothProgress:0});
this.addChild(_progressDisplay);
_progressDisplay.mouseEnabled = false;
_progressDisplay.x = 69;
_progressDisplay.y = 389;
_progressDisplay.addLoader(queue);

function progressHandler(event:LoaderEvent):void {

trace("progress: " + event.target.progress);
}

function completeHandler(event:LoaderEvent):void {
trace(event.target + " is complete!");
var SWF:ContentDisplay = LoaderMax.getContent("childClip");
addChild(queue.content)
removeChild(_progressDisplay);

}

function errorHandler(event:LoaderEvent):void {
trace("error occured with " + event.target + ": " + event.text);
}

 

Those all image are my asset that going to be cached (as website asset) and mainmovie.swf is my AS3 main program that will play after the load progress done.

 

So far, it load until mainmovie.swf, well displayed. but I found this error and the progress display stuck at 99%..

 

 

Error: Error #2099: The loading object is not sufficiently loaded to provide this information.
at flash.display::LoaderInfo/get width()
at com.greensock.loading.display::ContentDisplay/_update()
at com.greensock.loading.display::ContentDisplay/set rawContent()
at com.greensock.loading.core::DisplayObjectLoader/_initHandler()
at com.greensock.loading::SWFLoader/_init()
at com.greensock.loading::SWFLoader/_rslAddedHandler()
at flash.display::DisplayObjectContainer/addChild()

 

I hope someone can help me plz. thanks.

 

tesP.zip

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

First, I suspect you are using a very old version of LoaderMax, probably one you downloaded with one of our demos. Unfortunately it isn't practical to re-package every demo every time we make an update to the platform. You can grab the latest version of our code: http://www.greensock.com/v12/ (but I've attached it for you below)

 

I noticed you are using ProgressCircleLite. That was only intended for internal use and not something we support (noted in the source). We don't offer it anymore with our loading platform, so please remove it from your project so that you can use the latest extremely bug-free and stable version of LoaderMax.

 

In the future please provide an fla with all the necessary external assets that are required for it to function or replicate an error. You can just use really small images or swfs for externally loaded assets. It saves us some time, and allows us to serve you better.

 

I couldn't test loading 100 images but figured 1 image and 1 swf would suffice to see what was wrong.

 

here is code that works:


import com.greensock.*;
import com.greensock.loading.*;
import com.greensock.events.LoaderEvent;
import com.greensock.loading.display.*;

import flash.display.Sprite;
import flash.display.MovieClip;

LoaderMax.activate([imageLoader, SWFLoader, VideoLoader]);
var urls:Array = ["image.png"];

var queue:LoaderMax = LoaderMax.parse(urls, {name:"mainQueue",onComplete:completeHandler, onprogress:progressHandler, onerror:errorHandler});
//queue.append( new ImageLoader(urls, {container:this, bgColor:0xCCCCCC}) );
queue.append( new SWFLoader("module.swf", {name:"childClip", estimatedBytes:3000, container:this, autoPlay:true}) );

LoaderMax.prioritize("maiQueue");
queue.load();

function progressHandler(event:LoaderEvent):void {

trace("progress: " + event.target.progress);
}

function completeHandler(event:LoaderEvent):void {
trace(event.target + " is complete!");
var SWF:ContentDisplay = LoaderMax.getContent("childClip");

//notice queue.content is an array of ContentDisplay objects
trace(queue.content);

// bad
// addChild(queue.content) // you can't add an Array to the display list

//good (although you will probably want to look through the content array)
addChild(queue.content[0])

}

function errorHandler(event:LoaderEvent):void {
trace("error occured with " + event.target + ": " + event.text);
}

The real problem in your code was that you were doing

 

addChild(queue.content)

 

A LoaderMax's content is an Array of all the content that is loaded. You can't place an Array directly on the display list.

 

Minor non-issue is that you had {autoPlay:true} as the child vars object of your parse().

All of your assets in your parsed arrays are images and they can't be played. I don't think this causes and error... its just not necessary.

 

Also in your file you had

queue.append( new ImageLoader(urls, {container:this, bgColor:0xCCCCCC}) );

 

You can't pass an Array in as the URL property. I imagine you were just experimenting.

 

I have attached a zip of a working fla with the latest version (v12) of LoaderMax. Give it a spin.

 

LoaderMax can take a little time to wrap your head around. I'm glad you are giving it a shot. You're doing great. Let us know if we can help any more.

loadingDemo_CS5.zip

  • Like 1
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...