1 Reply Latest reply on Jun 7, 2010 1:20 PM by kglad

    localToGlobal confusion

    andib311

      Hi, I've been battling with this for around 4 days now and i'm sure the answer is quite simple but I'm having no luck.

       

      On my Stage I have an mc (mcOne) which via Actionscript (2.0) rotates clockwise and anticlockwise continuously for as long as the LEFT and RIGHT keys are held respectively. Within this mc is another mc (mcTwo) which via Actionscript moves up and down the stage (y and x) continuously for as long as the UP and DOWN keys are held respectively.

       

      The problem I've got is that mcTwo's perception of the x and y axis rotates in accordance with the rotation of mcOne. For instance, a 90degree rotation of mcOne will result in mcTwo now travelling horizontally across the stage.

       

      The desired effect is that mcOne always maintains a vertical motion - namely it will always head towards the top or bottom of the Stage regardless of how its parent mc has been rotated.

      I think I'm correct in saying that the method to achieve this involves the localToGlobal control, but I have been unsuccessfull in my attempts to make this work. Any help would be greatly appreciated.

       

      Thanks in advance.