Hi! Got an AS problem. Any help would be greatly appreciated!
(I'm using Flash MX)
I got:
- "spaceship" (player) on the main stage/scene
- "stage 1" MovieClip on the main stage/scene which inside houses another MovieClip "bullet"
How do I/What is the correct code to:
- Make the "bullet" inside the "Stage 1" MovieClip move towards the "spaceship"'s x/y position on the main stage? (Not follow it like a heat seeker, just move towards the player like a normal bullet would)
The code works when the bullet is placed outside of a movie clip, but not inside one.
Here it is: (remember this is placed on a MC within MC, how do I root it correctly to make it shoot towards an object on the main stage?)
onClipEvent (load) {
moveX = (this._x-_root.spaceship._x)/30;
moveY = (this._y-_root.spaceship._y)/30;
}
onClipEvent (enterFrame) {
this._x -= moveX;
this._y -= moveY;
nextFrame();
}
Thanks in advance! Any help would be most excellent!!