• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 235
  • Last Modified:

preloading many scenes in a movie

I have a movie (quite large) devited in many scenes.....

I made a preloader in the begining

bytes_loaded = Math.round(this.getBytesLoaded());
bytes_total = Math.round(this.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
this.loadBar._width = getPercent*100;
this.loadText = Math.round(getPercent*100)+"%";
if (bytes_loaded == bytes_total) {
     this.gotoAndPlay(3);
}

in frame 3 a have a button that if i press it I will see the first scene......My scenes are like that:
loading
Scene 1
ex 1
ex 2
ex 3
end

Is this preloader for all scenes or only for the loading scene?

Thanks everybody
Have a nice day and a wonderful weekend ;)
0
agapikoutsi
Asked:
agapikoutsi
  • 3
  • 3
  • 3
  • +2
1 Solution
 
henrywwCommented:
hmmm i didn't really know since i don't use scenes at all.

i had just test that getBytesTotal and it actually counts all scenes, so the preloader would work for all scene too

:) cheers
0
 
ocgstylesCommented:
Here is an idea...

Start the movie (Ctrl+Enter)
Click View > Bandwidth Profiler
Press Ctrl+Enter again to make the SWF stream.

The bandwidth profiler will tell you how big the SWF is.  Compare that with the getBytesTotal() value.  If they are just about equal, then it is probably preloading all scenes...

Not sure if this is correct, just a thought.
0
 
rascalpantsCommented:
since you are using "this" then the preloader is only checking for the bytes loaded of what ever "this" is...

You need to make a decision on how you want to preload the movie...  if you want the movie to play when an exact frame is loaded, then you need to use something like:

if(_framesLoaded <= _totalFrames){
//do something
} else {
//do something
}


If you want the preloader to play the movie when a set number of bytes are loaded, then you use the getBytesLoaded() method...

I prefer to use the frames method, because the Bandwidth profiler will tell you the number of frames that need to be loaded to have a smooth movie without stops...

I can email you a good preloader that displays a progress bar, the total download time left and bytes left...

just let me know...


rp



0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
henrywwCommented:
hmmm ... that's something i didn't try, ....
i was using _root.getBytesLoaded instead of "this"...

so what is "this" and where is "this"? interesting ...

well, rp's got a pt too, i never trust the profiler it's like the IE download timer tells u its only 2 mins to go and ends up 2 hrs later.

cheers
0
 
agapikoutsiAuthor Commented:
rascalpants............please do........

My email is agapi_koutsi@hotmail.com
0
 
elhyCommented:
the keyword "this" in this case should work like _root coz it is being called at the main timeline. unless the keyword "this" is being used in a mc, then it will refer to the mc itself.
0
 
rascalpantsCommented:
I email you the .fla today


rp
0
 
agapikoutsiAuthor Commented:
Thanks my friend.......
Kisses
A
0
 
rascalpantsCommented:
A... come back and close the question...


kisses ;)
rp
0
 
henrywwCommented:
wow ... what is that ... kisses all around?

i didn't get any kiss!!
no, not from u rp .. thanks !! :)

ha ha ha
0
 
agapikoutsiAuthor Commented:
Thanks again.......
See u around........ ;)
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now