5 Replies Latest reply on May 23, 2010 9:49 PM by JaxNa

    Arrow Move

    JaxNa Level 1

      Hey hi,

       

      in this image orange arrow i want to move left-right. and up-down, how i can do this, can u plz help me.

      arrow.JPG

       

      Thanks,

      JaxNa

        • 1. Re: Arrow Move
          kglad Adobe Community Professional & MVP

          use a loop and Key.isDown() method.  check the key class.

          • 2. Re: Arrow Move
            JaxNa Level 1

            see here is my code, but my arrow display like this, i want to display like 3D arrow.

            So what can i do for this?

             

            var intervalIDLine:Number;
            right_btn.onPress = function() {
                if (arrow_mc._rotation<0) {
                    arrow_mc._rotation = arrow_mc._rotation+5;
                }
                intervalIDLine = setInterval(setAngleRight, 200);
            };
            right_btn.onRelease = function() {
                clearInterval(intervalIDLine);
            };
            function setAngleRight() {
                if (arrow_mc._rotation<0) {
                    arrow_mc._rotation = arrow_mc._rotation+5;
                }
            }
            var intervalLeftID:Number;
            left_btn.onPress = function() {
                if (arrow_mc._rotation>=-172.094131469727) {
                    arrow_mc._rotation = arrow_mc._rotation-5;
                }
                intervalLeftID = setInterval(setAngleLeft, 200);
            };
            left_btn.onRelease = function() {
                clearInterval(intervalLeftID);
            };
            function setAngleLeft() {
                if (arrow_mc._rotation>=-172.094131469727) {
                    arrow_mc._rotation = arrow_mc._rotation-5;
                }
            }

            arrow.JPG

            • 3. Re: Arrow Move
              kglad Adobe Community Professional & MVP

              as2 doesn't have any 3d capabilities so you'll need to use a sequence of movieclips that display the various views or your arrow and then you'll need to code for the appropriate view to appear at the appropriate time.

              • 4. Re: Arrow Move
                JaxNa Level 1

                I tried this its working.

                thanks a lot.

                • 5. Re: Arrow Move
                  kglad Adobe Community Professional & MVP

                  you're welcome.