# Need help with variables as coordinates

**URL:** <https://forum.kirupa.com/t/need-help-with-variables-as-coordinates/289502>\
**Category:** flash\
**Created:** [May 31, 2009, 10:10pm UTC](https://forum.kirupa.com/t/need-help-with-variables-as-coordinates/289502 "2009-05-31T22:10:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bolteh](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@Bolteh](https://forum.kirupa.com/u/Bolteh)\
**Post date:** [May 31, 2009, 10:10pm UTC](https://forum.kirupa.com/t/need-help-with-variables-as-coordinates/289502/1 "2009-05-31T22:10:35Z")

</div>

I’m trying to set up an application that has certain movieclips that have to chance position depending on a selected option. The application basically has the main stage with a movieclip called “Options” and a movieclip called “Objects”. The selected options in the movieclip “Options” define what positions the movieclips in the “Objects” movieclip have later on.

I figured that I had to script it so that if I click “Option 1” in the “Options” movieclip, that it defined 2 variables called “option1\_x” and option1\_y" and when selecting Object 1 in the movieclip “Objects”, that it would set the X and Y values of “Object 1” to .x=object\_x and .y=object\_y

However, I’m rather new to AS3 (read: very new) and I’m struggling to figure out how to get this to work, because my attempts so far have been… rather bad.

What I have right now is this for the “Options” movieclip:

```auto

var object_x:Number=0;
var object_y:Number=0;

option01.addEventListener(MouseEvent.CLICK, Click01);

function Click01(e:MouseEvent):void{
     var object_x:Number="500";
     var object_y:Number="60";
}

```

And for the “Objects” movieclip:

```auto

object01.addEventListener(MouseEvent.CLICK, Click01);

function Click01(e:MouseEvent):void{
     this.Object01.x=object_x;
     this.Object01.y=object_y;
}

```

But this doesn’t work at all, sadly ☹ Anyone care to help?
