# Save the coordinates position of a child

**URL:** <https://forum.kirupa.com/t/save-the-coordinates-position-of-a-child/332114>\
**Category:** flash\
**Created:** [February 4, 2014, 10:51am UTC](https://forum.kirupa.com/t/save-the-coordinates-position-of-a-child/332114 "2014-02-04T10:51:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stephan\_Berger](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@Stephan\_Berger](https://forum.kirupa.com/u/Stephan_Berger)\
**Post date:** [February 4, 2014, 10:51am UTC](https://forum.kirupa.com/t/save-the-coordinates-position-of-a-child/332114/1 "2014-02-04T10:51:48Z")

</div>

Hi all,

I’ve got these functions :

```auto
private function onEmptySpaceClicked(e:MouseEvent):void{
			
    var myVar = e.currentTarget.name;

	if (e.currentTarget.name == "ES1"){
	trace("click on one");
	clickPuzzles.click1 = true;
	}
	if (e.currentTarget.name == "ES2"){
	trace("click on two");
	clickPuzzles.click2 = true;
	}

public function buildIt(e:MouseEvent):void{
if (clickPuzzles.click1){
        test.x = e.currentTarget.x;
	test.y = e.currentTarget.y;
	test.visible = true;
}
}

```

The builIt function is called by an other class.

Everything is working, but, is it possible to save e.currentTarget.x and y on the “onEmptySpaceClicked” function as a value ?

And then use it in my buildIt function ?

Like :

```auto

private function onEmptySpaceClicked(e:MouseEvent):void{    			
        var myVar = e.currentTarget.name;
    
    	if (e.currentTarget.name == "ES1"){
    	trace("click on one");
            clickPuzzles.click1 = true
    	e.currentTarget.x && e.currentTarget.y = valueOfEs1
    	}
    	if (e.currentTarget.name == "ES2"){
    	trace("click on two");
            clickPuzzles.click2 = true
    	e.currentTarget.x && e.currentTarget.y = valueOfEs2
    	}
    
    public function buildIt(e:MouseEvent):void{
    if (clickPuzzles.click1){
            test.position = valueOfEs1
    	test.visible = true;
    }
    if (clickPuzzles.click2){
            test.position = valueOfEs2
    	test.visible = true;
    }
    }

```

It is, of course, not a real code that I used but it is just for showing you the principle.

Thank you very much,
