# How do I target the object? Help me!

**URL:** https://forum.kirupa.com/t/how-do-i-target-the-object-help-me/320935
**Category:** flash
**Created:** [April 6, 2011, 2:44am UTC](https://forum.kirupa.com/t/how-do-i-target-the-object-help-me/320935 "2011-04-06T02:44:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![lungfatang](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@lungfatang](https://forum.kirupa.com/u/lungfatang)
#### Post date: [April 6, 2011, 2:44am UTC](https://forum.kirupa.com/t/how-do-i-target-the-object-help-me/320935/1 "2011-04-06T02:44:09Z")

</div>

var Square01:Squares = createNewObject(50, 50);  
var square02:Squares = createNewObject(150, 150);  
var square03:Squares = createNewObject(300, 300);

function createNewObject(xValue, yValue):Squares {  
var newObject:Squares = new Squares();  
newObject.x = xValue;  
newObject.y = yValue;  
addChild(newObject);  
addEventListener(MouseEvent.MOUSE\_DOWN, moveObject);  
return newObject;  
}

function moveObject(newObject){  
this.x += 10;  
}

basically this little program works but my question is how can I reference the newObject var in moveObject from the createNewObject function?  
Right now what it does is move the stage when I click on an object that is created.
