First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: Anthony_kid | Website: http://sumfusion.akassp.com/

Now, let's break that actionscript!

The First part:
stop();

That just stops on that Frame.

The part after that:


loadpercent = _root.getBytesLoaded() / _root.getBytesTotal * 100;

This part assigns a variable, with the name loadpercent. It gets the Bytes of the File that have already been loaded, divides it by the Total Bytes, and then multiplys it by 100, so that the division isn't a decmial.

The if statement..:


if(loadpercent != 100){
setProperty(bar, _xscale, loadpercent);
}else{
gotoAndStop(3);
}

First, the if statement tests to see that the variable loadpercent is at 100, which would mean it is fully loaded. It says if the variable doesn't equal 100, then use the setProperty(); function:

These are the parameters of the setProperty(); funtion: setProperty(target, property, value);

First, target. This tells the function what clip to target, and assign the follow property to.

Next, property. This is the property of the specific clip to set. In this case, _xscale.

And last, value. This is the value of the property being assigned. In this case, it was loadpercent.

Now, if the if statement returns true, then the setProperty(); function is used to show how much of the movie is loaded through a bar movieclip. If the statement returns false, and the movie is:

gotoAndStop(3);

This about sums it up! Basically, using actionscript, we test to see if the movie is loaded, and change the size of the bar if it isn't, and go to the nextframe if it is! I hope this tutorial helped you a great deal! Hopefully, in the future, I will write more tutorials! But I haven't much time to do so, what with sports and school...

P.S.:
I'm only 13 years old!! Lol..anyway, if you have any questions, feel free to email me at antsam@akassp.com, or, reach me on AIM (Aol Instant Messenger) at: MasnaX ! I'll be glad to help in anyway that I can! Thank you for reading!! Hope I've helped you!

» Level Intermediate

Added: 2004-04-30
Rating: 5 Votes: 151
(10 being the highest)
» Author
AIM: MasnaX EMAIL: antsam@akassp.com
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: Christopher E Vance
» Title: Aqua Live
» Description:

A vector based mermaid.

Featured Sound Loops
Image for equalize

Audio Player

» Author: Peter
» Title: Action
» Description: Funk Action Groove loop. let me know if you manage to find a use for it, would love to see it. Thanks
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: SoundScalpel
» Description: Cartoon stretching/expanding sound made from rubbing an inflated balloon.