Make my movie clip move from left to right with arrow buttons.


hi hope quick one..

i have elements set need logistics of how can acheive following:

i have arrow @ furthest left , furthest right of main flash movie. have movie clip in middle has indidivual images on kind of long strip. when click left arrow want movie begin move right left , visa versa. have achieved keyboard left , right keys need convert theory left , right arrow buttons?

var speed:number = 4;
object_mc.onenterframe = function() {
if (key.isdown(key.right)) {
this._x = this._x+speed;
} else if (key.isdown(key.left)) {
this._x = this._x-speed;
}
};


any appreciated??

thanks

ben

use getascii() or getcode() methods of key class. , can use trace function check values used in if-statement.


More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

How to format a Get Request

avrdude: verification error, first mismatch at byte 0x0000 0x0c != 0x62