The following AS works fine but I seek the wisdom of an AS guru to modify the action.
I have a tweened movie which plays on a loop. A click on the image area stops the movie and the image fades nicely from alpha 100 to alpha 0. A second click brings the image back immediately to alpha 100 and the clip continues.
I would like the movie image to fade back in from alpha0 to alpha 100 before it re-starts; (the reverse of the fade out). At the moment the re-appearence of the image is a crude jump. So far my ill informed tinkering has not worked.
import mx.transitions.Tween;
import mx.transitions.easing.*;
var secNum:Number = 3;
var aTween:Tween;
click_btn.onRelease = function() {
if (!this.toggle) {
chameleon.stop();
aTween = new Tween(chameleon, “_alpha”, Quad.easeInOut, 100, 0, secNum, true);
aTween.onMotionFinished = function() {
delete aTween;
chameleon._visible = false;
};
} else {
aTween.stop();
chameleon._visible = true;
chameleon._alpha = 100;
chameleon.play();
}
this.toggle = !this.toggle;
};