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.
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.
|» Level Intermediate|
Rating: 6 Votes: 183
|No information about the author has been provided|
|Download the files used in this tutorial.|
|Download (98 kb)|
|More help? Search our boards for quick answers!|