So, I am trying to make a flash game with a bomber plane with a rear-gunner. I have made the plane a movieclip and, inside that, have the gunner movieclip. I am trying to use key controls to move the plane and have the gunner follow the mouse cursor. I am not certain if there is a way to make the gunner movieclip stay attached to the plane and move independently. Right now the only thing that works is instantiating a gunner and adding it to the frame, but I am having problems keeping it in the right location while the plane moves.
0
votes
Well, I have a few classes at the moment. I can upload them all if you would like. But, I am mostly just trying to find out how to mess with a movieclip that is a part of another movieclip i.e. make it rotate on its own while the plane rotates.
- Paul
Or also, is there a way to make a reference point on a movieclip that I can get the location of. Not the Registration point thing. Because if I try and have the gunner offset from the center, the math gets all weird when the plane starts to rotate for the gun to stay in the same place.
- Paul
1 Answers
1
votes
you can refer to a movieclip in another movieclip by naming it
Picture example:
http://i.stack.imgur.com/weNeF.png
then you can refer to it in your actionscipt by writingyourPlane_mc.gun Example: yourPlane_mc.gun.rotation = mouseAngleToPlane