# HELP: need AS for advanced alpha fade using tween class

**URL:** https://forum.kirupa.com/t/help-need-as-for-advanced-alpha-fade-using-tween-class/224819
**Category:** flash
**Created:** [May 5, 2007, 9:58pm UTC](https://forum.kirupa.com/t/help-need-as-for-advanced-alpha-fade-using-tween-class/224819 "2007-05-05T21:58:12Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![zentripster](https://avatars.discourse-cdn.com/v4/letter/z/b9e5f3/32.png) [@zentripster](https://forum.kirupa.com/u/zentripster)
#### Post date: [May 5, 2007, 9:58pm UTC](https://forum.kirupa.com/t/help-need-as-for-advanced-alpha-fade-using-tween-class/224819/1 "2007-05-05T21:58:12Z")

</div>

Hello,

I am using the import tween class to control the alpha of my “rollover” image.  
Problem is that each time I “rollout” and them “rollover” again the alpha snaps back to 100%.  
This produces a strobe effect when I need a smooth fade.

I probably need a statment that constantly checks the alpha state and then fades up or down from it’s current value rather than snapping to 100% before fading.

Example: [http://www.caroyllabarge.com/2007/clb\_intro.html](http://www.caroyllabarge.com/2007/clb_intro.html)  
Here’s what I have now:

[SIZE=1]_on (rollOver) {  
import mx.transitions.Tween;  
import mx.transitions.easing._;  
fadeIN = new Tween(this.atmo\_mc.a\_shape\_mc, “\_alpha”, Regular.easeOut, 100, 0, .2, true);  
}

on (rollOut) {  
fadeIN = new Tween(this.atmo\_mc.a\_shape\_mc, “\_alpha”, Regular.easeOut, 0, 100, .2, true);  
}

on (release) {  
fadeIN = new Tween(this.atmo\_mc.a\_shape\_mc, “\_alpha”, Regular.easeOut, 0, 100, .2, true);  
}

\*[/SIZE]
