AS3 FadeIn & Out
- Started
- Last post
- 5 Responses
- georgesIII
I'm trying to make a simple button rollover, roll out,
but it doesn't work, I'm not the best in AS3can anyone tells me where I'm wrong in my code
thanks,import fl.transitions.Tween;
import fl.transitions.easing.*;ballerr.alpha = 0;
ballerr22.alpha = 0;
ballerr33.alpha = 0;var outTween:Tween;
btn_01.addEventListener(MouseEve... fadingout);function fadingout(event:MouseEvent): void {
if(ballerr.alpha == 1 ) trace("Goddammit_go to 100%");
else outTween = new Tween(ballerr, "alpha", None.easeNone, 0, 1, 1, true);
}
- georgesIII0
the btn is "btn_01", but it won't register, the alpha works
- ifeltdave0
Is it possible outTween is defined locally in a function? Maybe it's not existing yet. Is this all the code?
Any errors? Or just not working?
What if instead of firing the tween you hard set the alpha to 1, does it still change? If it doesn't your logic is messed up somehow.
- Aa770
let greensock into your life:
http://www.greensock.com/perfect tweening solutions, super simple coding... has a 4k file size nano version if you are doing banner work
- georgesIII0
still won't work,
i just wan ballerr to fade in and out with a rollover btn_01
In as2 I would have already finished it, but I don't get a3, at all
- jhey0
if (ballerr.alpha == 1 ) {
trace("do nothing");
} else {
trace("do it:");
TweenLite.to(yada, 1, {alpha:1});
}