PDA

View Full Version : _alpha or else


vik
02-14-2004, 05:24 AM
Hi!!!

Need help on this one.

I have a jpg file inside a folder that loads to a empty mc on the timeline.

i want to make a effect that fades the image from 0 to 100 when the image loads into the movie clip, how can i do this using AS.?

tanx for your time.

see ya soon. eheheh.

boyzdynasty
02-14-2004, 07:12 AM
hmm...just a guess....

set the MX alpha property to '0' MC._alpha = 0
load the pix into the empty MC

then you can use setInterval to gradually increase the )alpha property to 100.

AngelEyesShadow
02-15-2004, 02:53 AM
This code does what you want.


_root.createEmptyMovieClip("containerMC", 0);
containerMC.loadMovie("img.jpg");
containerMC._x = 0;
containerMC._y = 0;
containerMC._alpha = 0;
this.onEnterFrame = function() {
if (containerMC._alpha<100) {
containerMC._alpha += 5;
} else {
delete this.onEnterFrame;
}
};


Anything else? :D

boyzdynasty
02-15-2004, 07:49 AM
hehe...

that is little less complicated than the way I suggest (setInterval)

:p

then again...there is always more than one way to do things.

vik
02-15-2004, 01:33 PM
Tanx guys!!! your posts help me a lot.

bye...

pixelwit
02-15-2004, 03:50 PM
You'll probably need a preloader to check when the image is fully loaded before you start increasing the clip's alpha.

-PiXELWiT
http://www.pixelwit.com