# Modify AS 2.0 to include -alpha fade and restart

**URL:** <https://forum.kirupa.com/t/modify-as-2-0-to-include-alpha-fade-and-restart/303351>\
**Category:** Uncategorized\
**Created:** [January 19, 2010, 8:19am UTC](https://forum.kirupa.com/t/modify-as-2-0-to-include-alpha-fade-and-restart/303351 "2010-01-19T08:19:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TerraAustralia](https://avatars.discourse-cdn.com/v4/letter/t/51bf81/32.png) [@TerraAustralia](https://forum.kirupa.com/u/TerraAustralia)\
**Post date:** [January 19, 2010, 8:19am UTC](https://forum.kirupa.com/t/modify-as-2-0-to-include-alpha-fade-and-restart/303351/1 "2010-01-19T08:19:21Z")

</div>

I have just completed my first Flash 8 movie, named chameleon, which is a simple loop tween. I have made an invisible button the size of the image area so a user can click the image to stop it, and toggle click re-start to continue.  
A generous As Guru gave me this script which works fine:

click\_btn.onRelease=function(){  
if(!this.toggle){  
chameleon.stop();  
} else {  
chameleon.play();  
}  
this.toggle=!this.toggle;  
}

Now I want to have the stopped movie image slowly fade to -alpha zero over the span of 10 seconds, then instantly reappear in full colour when click started (100%-alpha).

I have scoured my Flash 8 Savvy book but am finding the learning curve too steep. Can anyone help me with the code to modify this AS to include the 10 seconds fade and re-start please.
