Essentially I have a movie that will load an external swf. I need to preload
this swf along with the main movie. The main timeline and the external swf
are to be synced together. So when the external swf and the main movie load
The main movie has a timeline that is just as long as the external clip.
They should play at the same time when loading of the external swf is done.
The main movie is not heavy in file size at all. It is the external swf that
"Patrick Bay" <patrickbay@sympatico.ca> wrote in message
news:cinaq6$gim$1@forums.macromedia.com...
> Hi,
>
> That's rather strange code you have there:
>
> actBytes = _level1.getBytesLoaded() || 0;
>
> totBytes = _level1.getBytesTotal() || 100;
>
> You're using a logical OR comparator. It will only return TRUE or FALSE
> (first of all), and only when getBytesLoaded or getBytesTotal are 1. Any
> other time they will return 0 (because 0 is logical FALSE and 100
> decimal's lower bit is also logical FALSE). Also, your percentage
> calculation is not correct. From what I can tell, this shouldn't work at
> all. Get rid of those logical ORs...
>
> Do something like this:
>
> // get the bytes loaded so far or 0 if we didn't start loading yet
> actBytes = _level1.getBytesLoaded();
> // get the total bytes to load or 100 if we didn't start loading yet
> totBytes = _level1.getBytesTotal();
> // calculate a percentage value of the bytes loaded
> percent = Math.round((actBytes/totBytes)*100);
>
>
> // if there are more bytes to load
> if( percent<100 ){
> // if you don't want a bar, delete the following line
> bar._xscale = percent;
> // go back to the loop
> gotoAndPlay(2)
> }
>
> Regards,
> Patrick
>
> -----------------------------------------------------
>
www.baynewmedia.com >
> IRC (
www.dal.net) -> #baynewmedia
> -----------------------------------------------------
>
>
>
> Joey D wrote:
>
> >Am I crazy? This should work right?
> >
> >I have tried this
http://www.bokelberg.de/actionscript/1.html and does
not
> >seem to work.
> >
> >Essentially I have a movie that will load an external swf. I need to
preload
> >this swf along with the main movie. The main timeline and the external
swf
> >are to be synced together. So when the external swf and the main movie
load
> >fully they will start to play at the same time.
> >
> >Unfortunately, I can not get this working correctly. Here is what I
have.
> >By the way. The external swf does not have a stop action in it. It is
from a
> >3rd party software program. It does have audio, otherwise I would have
> >imported it into the main movie. Any help greatly appreciated!
> >
> >Frame 1
> >loadMovieNum("myexternal.swf",1);
> >stop();
> >
> >Frame 2
> >(nothing here)
> >
> >Frame 3
> >// get the bytes loaded so far or 0 if we didn't start loading yet
> >actBytes = _level1.getBytesLoaded() || 0;
> >// get the total bytes to load or 100 if we didn't start loading yet
> >totBytes = _level1.getBytesTotal() || 100;
> >// calculate a percentage value of the bytes loaded
> >percent = Math.round(actBytes * 100 / totBytes);
> >
> >// if there are more bytes to load
> >if( totBytes - actBytes > 10){
> > // if you don't want a bar, delete the following line
> > bar._xscale = percent;
> > // go back to the loop
> > gotoAndPlay(2)
> >}
> >
> >
> >