Skip to main content
May 22, 2010
Answered

Arrow Move

  • May 22, 2010
  • 1 reply
  • 532 views

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.

Thanks,

JaxNa

This topic has been closed for replies.
Correct answer kglad

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.

1 reply

kglad
Community Expert
Community Expert
May 22, 2010

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

May 22, 2010

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;
    }
}

kglad
Community Expert
kgladCommunity ExpertCorrect answer
Community Expert
May 22, 2010

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.