lengstoRf
01-05-2005, 12:00 AM
i'm trying to use AS2 to cause a movie clip to fade to a certain alpha value using onClipEvent(enterFrame)...
...my goal is to set the initial alpha of the movie clip to 0, then, once a button is pressed, set the alpha to 50. the reason i want to use AS to do this is so that the fade isn't repeated if the button is pressed again...
...i'm a total noob at AS programming, so i'm sure i'm completely off-base here, but here's what i tried (this AS is placed on my movie clip):
onClipEvent(load){
var alpha = 0;
_alpha = 0;
speed = 5;
}
onClipEvent(enterFrame){
_alpha += (alpha - _alpha)/speed;
}
on each button i have:
on(release){
alpha = 50;
}
the button script i know is wrong. i'm not sure about my actual function...
...any help is greatly appreciated. thanks in advance!
...my goal is to set the initial alpha of the movie clip to 0, then, once a button is pressed, set the alpha to 50. the reason i want to use AS to do this is so that the fade isn't repeated if the button is pressed again...
...i'm a total noob at AS programming, so i'm sure i'm completely off-base here, but here's what i tried (this AS is placed on my movie clip):
onClipEvent(load){
var alpha = 0;
_alpha = 0;
speed = 5;
}
onClipEvent(enterFrame){
_alpha += (alpha - _alpha)/speed;
}
on each button i have:
on(release){
alpha = 50;
}
the button script i know is wrong. i'm not sure about my actual function...
...any help is greatly appreciated. thanks in advance!