all groups > flash actionscript > may 2004 >
You're in the

flash actionscript

group:

Preloader - help!



Preloader - help! geekstarUK
5/31/2004 9:30:24 PM
flash actionscript: Right,

I have attached the current swf for you to take a look at - it might help
explain the problem! (give the intro a sec to run)

At the moment, "Projecten" is on the main timeline, and all the images for
that section are on separate layers to allow for tweening. I want feedback for
the user in percentage loaded for the "Projecten" section and just this
section, not the entire movie.

How is it possible to target specific frames with a preloader? I've tried
using and modifying the code below but in vain.

totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = int(loadedBytes / totalBytes * 100);
if (_root._framesloaded >= _root._totalframes) {
gotoAndPlay("start");
}

Thankyou for any help!
Robin

Re: Preloader - help! flash matt
5/31/2004 11:41:58 PM
hi,

im working on this project with robin (as in he's sitting next to me), and can
get the movie to play if up to a certain amount of frames have loaded. but ....
still dont know the script for returning the percentage of PART OF a movie to
the user ...

using the below script - i would obviously make dynamic text boxes and label
them with 'totalBytes' etc ... to return values

totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = int(loadedBytes / totalBytes * 100);
if (percentDone >= 50) {
gotoAndPlay("start");
}

but how do i specify a selection of frames ( for example frames 50 - 70 ) so
i can return the percentage of those specific frames back to the user? or
target a movie clip on the main timeline ( not one that is dynamically loaded)
and return the percentage of that clip loaded to the user?

Please help - it's driving me mad !!!

thanks, Matt

i
Re: Preloader - help! Laiverd.COM
6/1/2004 12:20:54 AM
If you want to target specific frames there's no need to use getBytesTotal()
etc. Say you want frame 5 to have been loaded then the synatx would be
something like

if(_root._framesLoaded >= 5){
do things
}

Whether this is a reliable way to go about is dependent on the situation.
One doul of course also use the percentDone value. Say you want 50% of the
movie to load before playing, then you would end up with something like:

totalBytes = Math.round(getBytesTotal() / 1024);
loadedBytes = Math.round(getBytesLoaded() / 1024);
percentDone = int(loadedBytes / totalBytes * 100);
if (percentDone >= 50) {
gotoAndPlay("start");
}

John


--
----------------------------------------------------------------------------
-----------
RESOURCES
http://groups.google.com/advanced_group_search?hl=en&as_ugroup=*flash
----------------------------------------------------------------------------
-----------
TUTORIALS at
www.laiverd.com
Flash & PHP Emailform
Using textfiles in Flash
----------------------------------------------------------------------------
-----------

AddThis Social Bookmark Button