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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not a hypothetical question.... 3

Status
Not open for further replies.

natedeia

Technical User
May 8, 2001
365
US
In scene 1 I have one frame, this is my preloader.
In scene 2 I have one frame (is that bad or shoud i add more frames?), anyways there is one frame.
Now how do I make the Scene 1 preloader work?
Is this right? Hey, I am still learning and love this program and will have it down soon, just have to get my road blocks out of the way. Thanks all of you experts, I'm not on the list anymore but will soon be again.....
 
i frame is fine i guess as long as you use mc's to get the job done..as far as the pre-loader try this..

ifFrameLoaded ("scene2", 1) {
nextScene ();
play ();
}

e.gif


carlsatterwhite@endangeredgraphics.com
 
one frame i meant..sorry typo's..and also that action should be in the first frame of your loader scene..in the last frame of your loader have a

gotoAndPlay (1);

so that the loader keeps looping until scene 2 has loaded..
e.gif


carlsatterwhite@endangeredgraphics.com
 
Hey VERT2001, I made my second scene, the one you seen as 21 frames now. Well, the preloader is 25 frames. Should I have made it one frame and everything else as a MC on that one frame? I tried doing what you said above when it was just one frame on the preloader and was not able to get it to work properly. But now it seems more complicated since there are now 25 layers. I just have to read about preloaders again, as you can tell this my first preloader.
What would you suggest on this one, or any of you other Flash experts! At least I am still up on the FIREWORKS experts list, not that I am the greatest. Thanks for your help.
 
Ok, to make your preloader, make a new layer (Name it preloader) and create 1 keyframe in that layer, on frame 1. Go to Insert > New Symbol, and create a new movie clip. Make your preloader animation there...

Make sure to place a stop action in the first key frame (preloader keyframe), and add this actionscript on the MC, make it

ifFrameLoaded (2) {
gotoandplay (2);
}

It should play the MC of your preloader while on that page, and loop it, until frame 2 is loaded...once frame 2 is loaded, it says "HEY! it's loaded!" and moves on to frame 2.
 
all you woulda had to do natedeia was add one more frame to your preloader..in the first frame put the ifframeloaded actions..in the second frame just have the gotoandplay action to keep it looping..should work with only one frame..just have two frames for the preloader..
e.gif


carlsatterwhite@endangeredgraphics.com
 
Just to add to an already confusing thread... I agree with Virt; two frames and two layers should be all you need for a pre-loader.

In the first layer have two frames (not seperate key frames, just two frames) with the m/c's for the preloader in. In the second layer (actions only) have two keyframes; in the first have the code that Virt posted earlier, which checks for a given frame being loaded and if it is jumps to frame 3 or your scene or whatever, (or something more complex if you want to measure the k or % loaded) and in the second keyframe have the 'gotoAndPlay(1)' code.

The other bit that may be worth noting is check your publish settings; I think I'm right in saying that if you have 'bottom up' loading set then your pre-loader needs to be in the lowest layer and if you have 'top down' it needs to be at the top (so that it is loaded first!)

Hope this is helpful!

X-)

PetitPal
 
Here is some code out of one of my pre-loaders; this is a bit more advanced than your standard 'go to frame' but it means that if you put this into the first action keyframe and then have two text variables on your main timeline called kToLoad and percentLoaded then these will display the k of your movie and the percent loaded; which is quite nice (I also do a few more calculations, which I can send you in an fla if you want, to give a little progress meter).

To test your pre-loader (if you don't don't how to already) test your movie in flash (Ctrl + Enter) and then go to 'View / Show Streaming'; this simulates the movie being downloaded at a given baud rate (which can be set-up from the 'debug' option by choosing a 'K' setting).

The code follows...


// sort out variables holding movie size in bytes, etc...
_root.totalBytes = this.getBytesTotal();
_root.kToLoad = '(' + Math.round(_root.totalBytes / 1024) + 'k)'
_root.loadedBytes = this.getBytesLoaded();

// check if movie loaded...
if (_root.loadedBytes == _root.totalBytes) {
gotoAndPlay (3);
} else {
// work out percent loaded
_root.percentLoaded = Math.round((_root.loadedBytes / _root.totalBytes) * 100);
}


Hope this is useful!

X-)

PetitPal.

p.s. There are a few FAQs on pre-loaders that people like davdesign wrote which are very good.
 
that is a pretty involved pre loader for me. i will certainly check it out once i get this one working properly.

glad to see the great response on this, thanks everyone!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top