# localToGlobal problem

**URL:** https://forum.kirupa.com/t/localtoglobal-problem/22814
**Category:** flash
**Created:** [June 9, 2003, 7:32am UTC](https://forum.kirupa.com/t/localtoglobal-problem/22814 "2003-06-09T07:32:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![tstefan](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@tstefan](https://forum.kirupa.com/u/tstefan)
#### Post date: [June 9, 2003, 7:32am UTC](https://forum.kirupa.com/t/localtoglobal-problem/22814/1 "2003-06-09T07:32:30Z")

</div>

I have a litlle problem with localToGlobal command.  
I want to convert coordinates of movie clip inside another movie clip to global coordinates, but it seems it doesn’t work.  
What am I doing wrong?

[AS]  
for (n=0; n\<node2.length; n++) {  
refposit++;  
clip = cont2.attachMovie(“refItem”, “refItem”+n, n+200);  
refText = node2[n].attributes.referenca;  
if (refText.length\>8) {  
reference2.refLabel.\_height = reference2.refLabel.\_height_3;  
}  
reference2.refLabel.text = refText;  
clip.\_x = 558;  
clip.\_y = n_pomicanje;  
clip.onPress=function(){  
point = new Object();  
point.y=this.\_y;  
localToGlobal(point);  
updateAfterEvent;  
trace(point.y);  
myFunction(point.y);  
}[/AS]

:-\ :-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 2:10pm UTC](https://forum.kirupa.com/t/localtoglobal-problem/22814/2 "2003-06-09T14:10:41Z")

</div>

```auto

for (n=0; n<node2.length; n++) {
        refposit++;
        clip = cont2.attachMovie("refItem", "refItem"+n, n+200);
        refText = node2[n].attributes.referenca;
        if (refText.length>8) {
                reference2.refLabel._height = reference2.refLabel._height*3;
        }
        reference2.refLabel.text = refText;
        clip._x = 558;
        clip._y = n*pomicanje;
        clip.onPress=function(){
                point = new Object();
                point.y=this._y;
                localToGlobal(point);
                updateAfterEvent;
                trace(point.y);
                myFunction(point.y);
        }
}

```

is clip just a movieclip by any chance?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [June 9, 2003, 3:29pm UTC](https://forum.kirupa.com/t/localtoglobal-problem/22814/3 "2003-06-09T15:29:44Z")

</div>

Yes clip is variable containing the name of the movie clip.
