PDA

View Full Version : movieclip placement


jcee
01-18-2003, 03:15 PM
Ok I have a movieclip which i am putting the following script on
onClipEvent (load) {
count = 0
operator = -2;

i = 1;
secs = 5;
down = stop;
}
onClipEvent (enterFrame) {



if (count <= alphaLev && down) {
while(i==1){// this allows the following code to execute once each time

operator = 0;//stop fade
i++;}

if(_alpha<=1){down= false;}//when alpha reaches 1 down is set to false so the count can increase again

}
else if(!down){//run when down is false
if(_alpha >=50){//resets variables when alpha reaches 99%
stop;
alphaLev = 50;
operator = 0;}

else{operator = 2;}
}

count += operator;
this._alpha = count;
_root.test = _alpha;//alpha value
}



I knoe its messy but i just edited a movie from the library.
Anyway the effect i'm after is simply to fade in a clip to specific alpha value. This works ok.
However, when i place the clip in the timline it flashes on and off quickly and then does what its meant to do. If anyone can tell me how to stop the flashy bit i would be eternally grateful. Cheers

Ricod
01-18-2003, 04:31 PM
I think it's because when the frame is reached with the clip on it, it loads and is not changed on load, so the alpha = 100. Then, in the 1st frame (right after the onLoad) the alpha is set to the value of count + the value of operator, which is 0, so then disappears after which it will fade in, right ?

If you add a : this._alpha = 0;
to the onClipEvent(load), I think you will be rid of that small 'flash'.

jcee
01-18-2003, 05:17 PM
worked a treat thanks a lot

Ricod
01-18-2003, 07:57 PM
You're welcome :) !