PDA

View Full Version : Key Capture Help


Shashank
03-26-2003, 04:03 AM
HI!
Iam using this code for key capture

onClipEvent (keyDown) {
if (Key.isDown(Key.LEFT)) {
if (_x>25) {
_x -= 4;
}
} else if (Key.isDown(Key.RIGHT)) {
if (_x<195) {
_x += 4;
}
}
if (Key.isDown(Key.UP)) {
if (_y>60) {
_y -= 4;
}
} else if (Key.isDown(Key.DOWN)) {
if (_y<80) {
_y += 4;
}
}
}

Now my problem is as the movie clip moves up....i want it to be smaller in size , as in to show that it is away from the screen
.....
and as it come down , it should retail the size....

can any one help me

thankx

tost
03-26-2003, 06:31 AM
like this?


onClipEvent (keyDown) {
if (Key.isDown(Key.LEFT)) {
if (_x>25) {
_x -= 4;
}
} else if (Key.isDown(Key.RIGHT)) {
if (_x<195) {
_x += 4;
}
}
if (Key.isDown(Key.UP)) {
if (_y>60) {
_y -= 4;
_xscale -= 5;
_yscale -= 5;
}
} else if (Key.isDown(Key.DOWN)) {
if (_y<80) {
_y += 4;
_xscale += 5;
_yscale += 5;
}
}
}