# \[CS3\] Setting variables through button press for scripted animation

**URL:** https://forum.kirupa.com/t/cs3-setting-variables-through-button-press-for-scripted-animation/289721
**Category:** flash
**Created:** [June 3, 2009, 10:25pm UTC](https://forum.kirupa.com/t/cs3-setting-variables-through-button-press-for-scripted-animation/289721 "2009-06-03T22:25:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![TooRomeo](https://avatars.discourse-cdn.com/v4/letter/t/7bcc69/32.png) [@TooRomeo](https://forum.kirupa.com/u/TooRomeo)
#### Post date: [June 3, 2009, 10:25pm UTC](https://forum.kirupa.com/t/cs3-setting-variables-through-button-press-for-scripted-animation/289721/1 "2009-06-03T22:25:59Z")

</div>

Need some help in getting the following working:

```auto

stop();
import mx.transitions.Tween;
import mx.transitions.easing.*;

onEnterFrame = function () {
    var SQUARE_y:Tween = new Tween(square, "_y", Strong.easeOut, START_y, END_y, 1.5, true);
};
go_0.onRelease = function() {
    START_y = square._y;
    END_y = go_0._y+50;
};

```

What’s supposed to happen is when you click button “go\_0”, the object “square” will animate moving down.

Thanks in advance.
