Hi again!
Now I have another question, how do I bind a button to a mc. I have four buttons that should move a mc in four diffrent directions, I want the mc to move like the code below by pressing on the buttons. What should I do?
[COLOR=Navy]onClipEvent (enterFrame) {
if (Key.isDown(Key.UP)) {
speed += .3;
}
if (Key.isDown(Key.DOWN)) {
speed -= .25;
}
0.6xspeed
if (Math.abs(speed)>10) {
speed *= .9;
}
if (Key.isDown(Key.LEFT)) {
_rotation -= 4.5;
}
if (Key.isDown(Key.RIGHT)) {
_rotation += 4.5;
}
speed = 0.987;
x = Math.sin(_rotation(Math.PI/180))speed;
y = Math.cos(_rotation(Math.PI/180))speed-1;
if (!_root.move.hitTest(_x+x, _y+y, true)) {
_x += x;
_y += y;
} else {
speed *= -.6;[/COLOR]
}