# mx2004 Clip transformation stopping tween working

**URL:** <https://forum.kirupa.com/t/mx2004-clip-transformation-stopping-tween-working/282645>\
**Category:** Uncategorized\
**Created:** [February 24, 2009, 5:15pm UTC](https://forum.kirupa.com/t/mx2004-clip-transformation-stopping-tween-working/282645 "2009-02-24T17:15:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pup\_100](https://avatars.discourse-cdn.com/v4/letter/p/da6949/32.png) [@Pup\_100](https://forum.kirupa.com/u/Pup_100)\
**Post date:** [February 24, 2009, 5:15pm UTC](https://forum.kirupa.com/t/mx2004-clip-transformation-stopping-tween-working/282645/1 "2009-02-24T17:15:42Z")

</div>

Hi,

I have developed a “playing card” type movie that dynamically loads an image into a holding clip that is situated underneath another clip, so you have the classic 2 faces of a playing card.

When you click on the top clip, which simulates the back of a card, the card turns over to reveal the image on the front.

Now all this works fine in the demo movie I have constructed in order to present the problem in a simplified way for the Kirupa forum (The actual movie is a bit more involved, so I have just concentrated on the problem area.) The BIG problem I have got is that the cards are supposed to tween into a new position once they have been turned by the user & a button is pressed.

What happens now is if you press the button before turning the cards the whole tween works fine. Press the button after turning the card & it will NOT work!  
Anyone any ideas on this?

[Here](http://www.jdwyer.plus.com/demo.html) is an online demo of the movie. I would have liked to include the fla, but it is showing as too large @226KB?

Code for first frame of movie:

```auto
 
 
stop();
spd=10;
_root.holdingClips_array = [_root.one_mc.cardHold_mc, _root.two_mc.cardHold_mc, _root.three_mc.cardHold_mc];
_root.cardHoldingClips_array = [one_mc, two_mc, three_mc];
///////////////////////////////////////////////////////////////////////
for (var s = 0; s<3; s++) {
 _root.holdingClips_array[s].loadMovie("demoClip.swf", get);
}
//////////////////////////////////////////////////
flip = function () {
 spd = Math.abs(spd);
 this._xscale = 99;
 this.onEnterFrame = function() {
  this._xscale -= spd;
  if (this._xscale<=0) {
   this._xscale = 0;
   this.bg._visible = !this.bg._visible;
   spd *= -1;
  } else if (this._xscale>=100) {
   this._xscale = 100;
   delete this.onEnterFrame;
  }
 };
};
//////////////////////////////////////////////////////////////////////
_root.move_mc.onPress = function() {
 play();
};
for (var f = 0; f<=2; f++) {
 _root.cardHoldingClips_array[f].onPress = flip;
}

```
