I'm creating a game in Flash CS4 and using Actionscript 3.0.
I'm adding all my graphics via my AS3 code. I've 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.
My question was: "How do I access my main class that is built when flash makes my project". I still don't know how but I did create a basic enemy AI the same way you would think but instead of controlling it all via the enemy class I had to send values to methods in the enemy class via my main class that was created with my project.