Jump to content
Search Community

Issue concerning estimatedBytes

lucgeme test
Moderator Tag

Recommended Posts

I am trying to upload some graphic assets using XMLLoader and have noticed an unusual behavior concerning the estimatedBytes property.  The XML file  xml/assets2.xml does contain the estimatedBytes declared for all the xml childs and xml/assets.xml does not.
 

Everything works fine if estimatedBytes is explicit declared, but if I omit it, the preloader bar jumps ahead. Shouldn't work just fine for both cases? Am I doing something wrong?

I have uploaded the files so you can take a look.

Desktop.zip

 

Edit: I am testing with Flash CS6(simulate download)

Link to comment
Share on other sites

That sounds like expected behavior to me. Check out the explanation in tip #8 and #9 here: http://www.greensock.com/loadermax-tips/#8

 

There's no way for it to know how big the files are before starting to load them - that's why estimatedBytes is key. But you could also use rawProgress if you don't mind some acceleration/deceleration of the progress bar. 

Link to comment
Share on other sites

Firstly, do you know where can I download the interactive demo from http://www.greensock.com/loadermax-tips/#8? It's not present in the source files at: http://www.greensock.com/as/LoaderMax/Meet_LoaderMax.zip.

 

Secondly, I have 3 loaders (ImageLoader, SWFLoader, MP3Loader) defined in an XML file that loads assets automatically. Although the estimatedBytes is very accurate the progress goes very fast to about 90% then smoothly reaches 100% without jumping forward or backward. Whether I use progress or rawProgress properties to track the loading progress, the outcome is the same. How can I get a smooth progress bar from begginning till end?

<?xml version="1.0" encoding="utf-8" ?>
<data>
	<LoaderMax name="bookPages" maxConnections="1" load="true" prependURLs="pages/">
		<SWFLoader name="cover_front_out" url="cover_front_out.swf" estimatedBytes="242700" />
		<SWFLoader name="cover_front_in" url="cover_front_in.swf" estimatedBytes="15000" />
                ...
	</LoaderMax>
	<LoaderMax name="tracks" maxConnections="1" load="true" prependURLs="mp3/" >
		<MP3Loader name="BustedChump" url="BustedChump.mp3" autoPlay="false" estimatedBytes="1376000" /> 
		<MP3Loader name="ChuckedKnuckles" url="ChuckedKnuckles.mp3" autoPlay="false" estimatedBytes="1800000" />
		...
	</LoaderMax>
	<LoaderMax name="logos" maxConnections="1" load="false" prependURLs="images/" >
		<SWFLoader name="uoradea" url="logo.swf" autoPlay="false" estimatedBytes="6330" />
	</LoaderMax>
	<LoaderMax name="backgrounds" maxConnections="1" load="true" prependURLs="images/">
		<ImageLoader name="a2.jpg"   url="a2.jpg" type="pattern" estimatedBytes="3000" />
		<ImageLoader name="bg.png"   url="bg.png" type="center" estimatedBytes="15000" />
                ...
	</LoaderMax>
</data>
LoaderMax.activate([ImageLoader, SWFLoader, MP3Loader]);
var queue:LoaderMax = new LoaderMax({name: "mainQueue",
				maxConnections: 1,
				auditSize:false,
				autoDispose:true,
				onProgress:progressHandler,
				onComplete: completeHandler,
				onChildComplete:childCompleteHandler,
				onError: errorHandler});
queue.append(new XMLLoader("xml/assets.xml", {name:"graphics", estimatedBytes:8476021}));
queue.load();
...
Link to comment
Share on other sites

Are you only using Flash's built-in bandwidth profiler or are you actually testing on a live, remote server? Flash's "simulate download" feature is not terribly accurate all the time. 

 

It would be helpful if we could rule out the simulate download feature being the issue.

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