I'm creating a game in Flash CS4 and using Actionscrip 3.0
I'm adding all my graphics via my AS3 code. I added my hero (A movie clip instance) in the main game class. In my enemy class (the movieclip) I want to make a generic AI which will check to see how close the hero is to the enemy. I tried various ways but I'm not sure how to properly access the X position of my hero from the code in my enemy movie clip.
I tried accessing it using thing such as: hero.x, GAMENAME.hero.x and parent.hero.x but keep getting errors. I'm not too sure what I need to do here.