First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: Gavin Powell | Website: http://www.cs.cf.ac.uk/user/G.R.Powell/

Preloader - Loading

Now we need to work out which frame we need to check is loaded using the needle position, start and end point of the movie and the amount the user wants to buffer. Easy! :-)

In the expression box put Int(start_frame+((buffer_length/100)*((end_frame-start_frame) / needle_points)*position)) The position is the needle position on the dial and will range from 0-8.

Note: You must convert the answer to an integer using Int() as flash won't convert it itself when checking if that frame is loaded, i.e. it cacn't check if frame 112.34 is loaded.

Then choose Set Variable from the menu and position as the variable and position+1 as the value, make sure that it is an expression not a String literal. Then choose Go To from the drop down menu and choose expression and enter GetProperty ( "", _currentframe )+2 and check the Go To and Play box.

Now you could have entered numbers instead of using these variables but what if you want to add a couple of frames somewhere in the preloader for some reason you would have to alter all these values, so using these variables is more dynamic. Also some people put the preloader in a different scene whereas I just plonk it before the rest of the movie so the start point of my movie can change as well. These can become even more dynamic when you write one frame action which can then recalled by other frames. This saves on your writing actions again and again and keeps file sizes down.

Anyway back to it. In the next keyframe Make a frame action of Go To and Play(GetProperty ("",_currentframe)-1). Now highlight these two keyframes and copy frames from the edit menu. Then Paste Frames for the next 16 frames so that they co-incide with the needle pointer positions. The first frame action checks if the relevant frame is loaded if it is it increments the position variable and the movie progresses two frames to the next If Frame is Loaded. If it is not then it progresses to the next frame which then returns to the previous frame. This is just a little loop that continues until the required frame is loaded, it needs to loop so that the load status is constantly checked.

Hint:- When writing anything but the simplest of action scripts use the script editor as it will check for syntax errors, if there are errors they won't show at runtime.

» Level Intermediate

Added: 2000-10-04
Rating: 6 Votes: 183
(10 being the highest)
» Author
No information about the author has been provided
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!


  • 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: Inocreato
» Title: RaiseTheBlocks
» Description: Raise all the blocks to win the game
Featured Sound Loops
Image for equalize

Audio Player

» Author: TomCat Carty
» Title: The Wood
» Description: Just a little game ending or it can maybe be looped. Recorders with music box and percussion to give the feel of well, I don't know, the woods? Free to use, just credit me. thank you
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: Davisigner
» Description: Hmm... what to say about this one? It's reminiscent of the closing notes of the opening music from the Three Stooges done in a church organ style with a closing cymbal crash. I'll give this one away gratis, but feel free to check out my free loops and potential upcoming license-mandated ones over in the respective part of Flashkit.