# Tweens, buttons and targets question

**URL:** <https://forum.kirupa.com/t/tweens-buttons-and-targets-question/258257>\
**Category:** flash\
**Created:** [April 22, 2008, 3:05pm UTC](https://forum.kirupa.com/t/tweens-buttons-and-targets-question/258257 "2008-04-22T15:05:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![madfatter](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@madfatter](https://forum.kirupa.com/u/madfatter)\
**Post date:** [April 22, 2008, 3:05pm UTC](https://forum.kirupa.com/t/tweens-buttons-and-targets-question/258257/1 "2008-04-22T15:05:20Z")

</div>

Hi,

I’m trying to create buttons from MovieClips that use a tween to change their opacity and enlarge them. The code for the up state looks like this:

[FONT=“Courier New”]var evtTargetalpha:Tween;  
var evtTargetscaleX:Tween;  
var evtTargetscaleY:Tween;

function btnEnlarge(evt:MouseEvent):void {  
var mcTargetGrow:Object = evt.target;  
evt.target.removeEventListener(MouseEvent.ROLL\_OVER, btnEnlarge);  
evtTargetalpha = new Tween(mcTargetGrow, “alpha”, Regular.easeOut, 0, 1, .2, true);  
evtTargetalpha.addEventListener(TweenEvent.MOTION\_FINISH, changeBtnSize);

```
function changeBtnSize(evt:TweenEvent):void {
	sndBooks.play();
	evtTargetscaleX = new Tween(mcTargetGrow, "scaleX", Regular.easeOut, 0.545, 1, .5, true);
	evtTargetscaleY= new Tween(mcTargetGrow, "scaleY", Regular.easeOut, 0.545, 1, .5, true);
}
evt.target.addEventListener(MouseEvent.ROLL_OUT, btnShrink); 

```

}[/FONT]

Occasionally the buttons will stutter or flash as if they are registering the roll\_over multiple times. I thought that maybe the problem is that the tween is on the button itself. I created a MovieClip as the hit state and wanted to target a different MovieClip to do the tweening. For instance the evt.target.name would be “button” and the MovieClip that I want to tween would be called button\_tw. But I can’t figure out how to do this. I’m mixing up MovieClip instances and strings.

:h:  
My questions are: is there a way to access a different MovieClip using evt.target this way? or is this just a bad way to make a button and I should try something else?

Thank you for any advice.
