PDA

View Full Version : zoom in/out effect ...


b2tehrizzo
02-16-2007, 04:17 AM
my code looks correct, but isn't doing anything ... just wondering if i'm missing something really stupid or am i way off.

i want to have an mc zoom in and out upon a keypress
here's the code i attach to the mc that will zoom in and out:
onClipEvent (load) {
clipScale = 100;
}
onClipEvent (enterFrame) {
if (clipScale != 100) {
// this code is for an easing effect
// but the normal code doesn't work
// yet, so we'll start with baby steps
//
//this._xscale += clipScale/2;
//this._yscale += clipScale/2;
//
this._xscale = clipScale;
this._yscale = clipScale;
}
}
onClipEvent (keyDown) {
if (Key.isDown(45)) { // - (minus key is pressed)
clipScale = 75;
} else if (Key.isDown(61)) { // = (equal key is pressed)
clipScale = 150;
}
}

can anyone spot what i did wrong ...

any help would be appreciated!

mary_ftech
02-20-2007, 07:16 AM
key code for minus is 189

key code for = is 187