PDA

View Full Version : Alpha Preloader Effect!


goku
10-22-2003, 06:33 PM
Please check out the link below:

http://eyewideshut.yookando.com

Click on 'On land' section - you will get a pop-up box, click one of the options and you get a slide show of images by clicking on the main image.

I hope this is making sense so far?

My question is how is the alpha preload bar effect done? Is there a blank movie clip in which the next image loads into and is the preloading bar in a scene or actionscript?

Sorry if this sounds confusing, but could someone let me know how it was done. A fla example would help alot.



:confused: :

JHallam
10-22-2003, 08:35 PM
Basically, the base .swf loads in seperate swf's which are the images.

Each sep .swf has a simple preloader and a coloured bar, call it up, load, display, done.

goku
10-23-2003, 06:02 PM
Thanks for the reply JHallam - but still don't understand?

Any chance of an example?

:confused:

JHallam
10-23-2003, 08:59 PM
Ok, stick around, I'll hopefully get a fla up for you, Ive got alot on so keep patient ;) tonight or tomorrow sometime :)

Colin Campbell
10-23-2003, 09:46 PM
Hey, here would be an example of the preloader bar:


onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
percent -= (percent-((loading/total)*100))*.25;
per = int(percent);
percentage = per+"%";
loadBar._xscale = per;
if (percent>99) {
_parent.gotoAndStop(2);
}
}



So the remainder being what would the .fla possibly look like? *going off top of head* Well, the preloader actionscript would be in the "child" .fla, and on frame 1 of any scene *but I'd suggest not using scenes*

Anyway, on frame 2 there would be a .jpg, or the rest of the .swf if desired.

Now, in the parent .swf, you would have next button, on press, load the child .swf, using the loadMovie command. I'm sure theres other ways around it.

If you were wondering about how to change the alpha of the box *i doubt it* but you would go into its properties, and change the alpha from there. By my eye, it looks to be around 50%, but I could be wrong.

have a good night. Colin.

Timmee_3Styler
10-24-2003, 02:58 AM
did u just hand code that colin?
if so
wow u have learnt quite alot

goku
10-24-2003, 07:12 AM
sorry to sound stupid Colin campbell - does the script go in a keyframe or MC?

JHallam
10-24-2003, 10:25 AM
Hey Goku, I have a example .fla for you but I rather let you have ago...if not then I will upload the fla.

Basically, you have a base, then just use the loadMovie function to load another swf, then inside that .swf, just have on frame 2 or after the animation, something like -


btot = getBytesTotal();
bloaded = getBytesLoaded();
loadText = Math.round(bloaded / btot * 100);
loadbar._xscale = loadText;
if (bloaded == btot) {
gotoAndPlay(10);//whatever Frame you want to start the movie

}
else {
gotoAndPlay(_currentframe - 1)
}


Something like that will do, just stick the loadbar on same frame as this with obviously "loadbar" as the instance.

That should work

Give that a try!