Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

preloader 1

Status
Not open for further replies.

Sue22

Programmer
Aug 9, 2002
6
GB
hi

everyone, i can a long way in flash, just cant get the hang
of a preloder, is there a place were there is a very easy
understanding,

thank you all..
 
A Preloader is simple. Basicly it's just a movie that dosen't do anything until the movie has progressed in loading. All you need to do is:

1) Create a new scene in a current project. You could name this scene "Preloader" to help you navigate.

2) Select the rectangle tool and draw a long and thin rectangle. Now, select the rectangle you just created (including the lines) and press 'F8' to create a symbol of rectangle. Name it 'Progress Bar' or 'Bar'.

3) Once it has been transformed into a symbol, open it by double clicking it in the libary.

4) Goto frame 100 and select it. Press the 'F5' key to create frames up to that point.

5) Select the fill of your rectangle (and not the lines) and press Ctrl + x to cut it.

6) create a new layer and Select frame 1 in it. Press Ctrl + Shift + V to paste it in the same place. Make sure this new layer is the lowerest. If not, just click the layers name and drag it below.

7) Goto frame 100 on the fill layer and select it. Press 'F6' to make it into a keyframe. Now, go back to frame 1 and select ALMOST ALL of the fill except for a tiny peice at the far left. Press 'Delete'.

8) Make sure frame 1 of the fill layer is still selected. Open the frame properties by right clicking on the frame in the timeline and selecting 'pannels' the 'frame' (flash 5) or by opening the properties (flash MX).

9) where it shows tweening: none, click the drop down menu and select shape.

10) Right click on frame 1 of either layer and click on 'Actions'. Then add:

Code:
Stop();

11) go back to the preloader scene and select frame 5. press 'F5'. Then select frame 2 and press 'F6'. Do the same to frame 3 and frame 5. You should now have keyframes at frames 1,2,3 and 5.

12) add the following code to frame 2:

Code:
loaded = int(_root.getBytesLoaded()/_root.getBytesTotal()*100);
if (loaded>=100) {
	gotoAndPlay (4);
} else {
	tellTarget (bar) {
		gotoAndStop (int(_root.getBytesLoaded()/_root.getBytesTotal()*100));
	}
	percent = loaded add "%";
}

13) Now add the following code to frame 3:

Code:
gotoAndPlay(2);

--------------------

IMPORTANT: You need to have another scene after the preloader scene with a stop(); command in it. If you don't, it will play the next scene the show then preloader scene again. To manage scenes, click the 'Window' menu then 'Panels', then 'Scene' (Flash 5) or just click 'Scenes' (Flash MX)

YOU SHOULD NOW HAVE A WORKING PRELOADER :)
 
thanks for all your help, i undersood everything, till i added the 3 scene for the stop action, and all that happen was the loader showed for a sec and the the screen was white, how do i set it up for the 3 scene

thank you for your help
 
thanks for all your help, i undersood everything, till i added the 3 scene for the stop action, and all that happen was the loader showed for a sec and the the screen was white, how do i set it up for the 3 scene

thank you for your help
 
thanks for all your help, i undersood everything, till i added the 3 scene for the stop action, and all that happen was the loader showed for a sec and the the screen was white, how do i set it up for the 3 scene

thank you for your help
 
This is because when you play your movie, it only take half a sec to load because it's on a local machine, on the internet it won't just flash up.
 
hm I'm trying to implement it for my movie, but the main scene seems 'freezed' when I had the preloader scene..
I really don't understand what happens..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top