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

Hi hope this is a quick one..

I have all the elements set up already so just need the logistics of how i can acheive the following:

I have an arrow at the furthest left and furthest right of my main flash movie. I then have a movie clip in the middle which has indidivual images on a kind of long strip. When i click the left arrow i want the movie to begin to move from the right to the left and visa versa. I have achieved this with the keyboard left and right keys so what i really need is to convert this theory for the left and 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 help will be greatly appreciated??

Thanks

Eddie

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

are you using AS2 or 3 (looking at your code, it looks like AS2)?

Daniel Marino | www.iamdanielmarino.com

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

var speed:Number = 4;
var moveRight : Boolean;
var moveLeft : Boolean;
object_mc.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT) || moveRight ) {
this._x = this._x+speed;
} else if (Key.isDown(Key.LEFT || moveLeft)) {
this._x = this._x-speed;
} else {
this._x = this._x;
}
};

yourRightArrow.onRollOver = function() {
moveRight = true;
}

yourRightArrow.onRollOut = function() {
moveRight = false;
}

yourLeftArrow.onRollOver = function() {
moveLeft = true;
}

yourLeftArrow.onRollOut = function() {
moveLeft = false;
}

//Untested...
"...porque Jehová tu Dios estará contigo en dondequiera que vayas." Joshua 1:9