ClioSport.net

Register a free account today to become a member!
Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

  • When you purchase through links on our site, we may earn an affiliate commission. Read more here.

Looking for a bit of Flash script



  S13
Morning all,

Quick question, I need a bit of flash code that will allow my movie to skip frames upon repeating. I'm intending to use it in this situation, I've made a movie which is about 850kb, so on the start of it I nicked a basic script off the net which is a loader:

if( getBytesLoaded() >= getBytesTotal() ){
gotoAndPlay(5);
} else {
gotoAndPlay(1);
}

Which coupled with a very simple 'Loading...' bit of text is my loader, it works fine I'm happy with it but when the movie repeats it very breifly shows this loading screen again. Is there a bit of code I can use to get the movie to skip the first few frames when it repeats? Or, does anyone have a loading script that shows a percentage and doesn't show on repeat? :eek:

Please bare in mind any answers will have to be in step by step format as I'm very new to flash.

Thanks in advance,

Rob.
 
  S13
Ok no worries, just stumbled onto the answer myself.

Simply put gotoAndPlay(5) in the action window on the last frame of the movie.
 
  S13
Ok no worries, just stumbled onto the answer myself.

Simply put gotoAndPlay(5) in the action window on the last frame of the movie.

Should have written gotoAndPlay(#), # being the number of the frame the movie starts on just to clear that up.

Still after making a percentage display though if anyone can help me with that?

So far I've got:

var percentage;
percentage=Math.ceil((getBytesLoaded()/getBytesTotal())*100);

I've got no idea how to make that display as a graphic or piece of text in the frame though lol.
 
  S13
Yeah I've tried a few on Google, following the instructions to the letter and none of them seem to work, getting massively hacked off with it now and can't for the life of me figure out what I'm doing wrong.
 
  S13
That one you've linked to there is exactly what I'm looking for.

I've got that one about a quarter working which is more progress than I've had with any others.

When exported as a movie file, this one loads the stuff, shows a percentage as a number figure. However, the movie then does not load and I'm left with just my 'loading' on a blank screen.

When you play it in mx, it runs the movie but leaves the loading text over the top of it..

I followed the instructions to the letter, obviously it's fucked up somewhere along the line where I've tried to add it to the movie I've already created rather than just create a new movie like the tutorial tells you..
 
  Fiat Bravo Active TJet
Could you copy and paste the code, and lets take a look at what's going on there....
 


Top