# Transition tween on movie start

**URL:** <https://forum.kirupa.com/t/transition-tween-on-movie-start/178585>\
**Category:** Uncategorized\
**Created:** [February 12, 2006, 6:33am UTC](https://forum.kirupa.com/t/transition-tween-on-movie-start/178585 "2006-02-12T06:33:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dirksmith](https://avatars.discourse-cdn.com/v4/letter/d/47e85d/32.png) [@dirksmith](https://forum.kirupa.com/u/dirksmith)\
**Post date:** [February 12, 2006, 6:33am UTC](https://forum.kirupa.com/t/transition-tween-on-movie-start/178585/1 "2006-02-12T06:33:29Z")

</div>

Hi

I’m developing a site using the mx transition tweens - triggered by a bt click: [http://www.detkendesign.com/detken3/test3.php](http://www.detkendesign.com/detken3/test3.php) (still in it’s early stage).

I’d like the first bt action to be triggered as soon as the movie opens - so the home bt is triggered and resets the ‘holding’ rectangle to it’s new scale contained in the tween.

Any ideas on how this can be done - I assume changing the on(release) aspect of bt1?

Thanx for any input

Dirk

The script:

```auto
stop();

import mx.transitions.Tween;
import mx.transitions.easing.*;
MovieClip.prototype.tween = function(theProp:String, from:Number, to:Number, time:Number) {
    _global.when = new Tween(this, theProp, Strong.easeInOut, from, to, time, true);
};

btn1.onRelease = function() {
    //first move to center in one second witih no delay
    main_mc.tween("_x", 400, 329, 1);
    main_mc.tween("_y", 100, 126, 1);
    // and in 2 seconds scale closer
    main_mc.tween("_xscale", 100, 120, 2);
    main_mc.tween("_yscale", 100, 120, 2);
    _global.when.onMotionFinished = function() {
        
        trace("ok");
    };
}

btn2.onRelease = function() {
    gotoAndStop("bt2");
    //first move to center in one second witih no delay
    main_mc.tween("_x", 0, -717, 1);
    main_mc.tween("_y",0, 126, 1);
    // and in 2 seconds scale closer
    main_mc.tween("_xscale", 100, 120, 2);
    main_mc.tween("_yscale", 100, 120, 2);
    _global.when.onMotionFinished = function() {
        
        trace("ok");
};
}
btn3.onRelease = function() {
    gotoAndStop("bt3");
    //first move to center in one second witih no delay
    main_mc.tween("_x", 0, 329, 1);
    main_mc.tween("_y", 0,-632, 1);
    // and in 2 seconds scale closer
    main_mc.tween("_xscale", 100, 120, 2);
    main_mc.tween("_yscale", 100, 120, 2);
    _global.when.onMotionFinished = function() {
        
        trace("ok");
};
}

```
