Jump to content
Search Community

progess animation everytime i load..

davidino1978 test
Moderator Tag

Recommended Posts

I'm not sure I understand what you mean by "play my progress" but I'm assuming you need a way to display the progress loading every time an element (an image, a SWF, a sound, a video, or an XML perhaps??) is loading, right?

 

Anyway, regardless of what you're loading, the loading duration will always depend on several factors, i.e. the speed of the Internet connection, the filesize of the loaded file; obviously if the file is already cached by the browser, then the loading will complete almost instantaneously, hence the apparent 100% loading progress you mentioned.

 

If you still want to display a smooth loading progress, I'd suggest you simulate the loading if the item is already cached by the browser, e.g. use a Timer object to check if the time passed since the file loading has started until the loading is complete is shorter than, say 100ms. Does it make sense? ;)

 

Hope this helps!

 

Cheers,

Dani

Link to comment
Share on other sites

You could also tween the progress value, like:

 

function progressHandler(event:LoaderEvent):void {
   TweenLite.to(myProgressBar, 0.5, {scaleX:event.target.progress});
}

 

Of course that means the display could always be 0.5 seconds behind the real value, but it does give a nice look to things overall.

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