# \[AS\]Button script in tween motion!

**URL:** <https://forum.kirupa.com/t/as-button-script-in-tween-motion/188609>\
**Category:** flash\
**Created:** [May 9, 2006, 12:48pm UTC](https://forum.kirupa.com/t/as-button-script-in-tween-motion/188609 "2006-05-09T12:48:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![btibia](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/btibia/32/1625_2.png) [@btibia](https://forum.kirupa.com/u/btibia)\
**Post date:** [May 9, 2006, 12:48pm UTC](https://forum.kirupa.com/t/as-button-script-in-tween-motion/188609/1 "2006-05-09T12:48:14Z")

</div>

Hi guys,

I have a small problem, i want to use the tween transition class in a project of my(i want to keep as low size as i can the .swf). I have applied the tween transition class to some mc that are button, but after the transition is complete the actionscript for the btns is not working. The code that i used is like this:  
First keyframe:  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000FF]import[/COLOR] mx.[COLOR=#000080]transitions[/COLOR].[COLOR=#000080]Tween[/COLOR];  
[COLOR=#0000FF]import[/COLOR] mx.[COLOR=#000080]transitions[/COLOR].[COLOR=#000080]easing[/COLOR].\*;  
[COLOR=#000000] **var** [/COLOR] tween\_btn\_x:Tween = [COLOR=#000000] **new** [/COLOR] TweenCOLOR=#000000[/COLOR];  
[COLOR=#000000] **var** [/COLOR] tween\_btn\_y:Tween = [COLOR=#000000] **new** [/COLOR] TweenCOLOR=#000000[/COLOR];  
[/LEFT]  
[/FONT]

And in the keyframe 11, i have this code:  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000FF]stop[/COLOR]COLOR=#000000[/COLOR];  
btn1.[COLOR=#0000FF]onRelease[/COLOR] = [COLOR=#000000] **function** [/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]gotoAndPlay[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

In frame 12 the mc with the instance name “btn1” has a motion tween(frame motion tween) until frame 22 where i have a  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000FF]stop[/COLOR]COLOR=#000000[/COLOR];  
[/LEFT]  
[/FONT]

So when I enter in the frame 11 the movie stops and if i release the btn, the movie plays but the btn is not moving!

Can somebody help me with this?

Thanks in advanced, btibia.
