0

I have a movie clip in my flash i've duplicated it by right clicking on it and renamed the duplicated as enemy1. when im trying to print it's coordinate by using:

trace(_root.enemy1._x);

It is printed as undefined. How can i find the location of it? Thank you

RAVITEJA SATYAVADA
  • 2,503
  • 23
  • 56
  • 88
  • have you duplicated the symbol in the library or copy/pasted the instance on stage ? – George Profenza Oct 12 '12 at 18:31
  • 1
    _root means a reference to the main stage, so unless you take that duplicated movie clip from the library, drop it on stage and set it's instance name to enemy1, `trace(_root.enemy1);` will output `undefined`. The other option is to [attach the movie](http://help.adobe.com/en_US/AS2LCR/Flash_10.0/help.html?content=00001278.html) from actionscript (but you also need to tick the **Export for Actionscript** option for the symbol) like so: `var enemy1:MovieClip = attachMovie("enemy1", "enemy1", this.getNextHighestDepth());trace(enemy1._x);` – George Profenza Oct 12 '12 at 18:56

0 Answers0