PDA

View Full Version : script help


tjnashster
07-09-2008, 08:14 PM
is there a way this zoom script can be adapted so it zooms in on up arrow press and zooms out on down arrow press.

onClipEvent (load){
this._xscale = this._xscale+10;
this._yscale = this._yscale+10;
if ((this._xscale >= 200) && this._yscale >= 200) {
this._xscale = 200;
this._yscale = 200;
}
}

Noct
07-16-2008, 07:10 PM
Take it off the clip and use a key listener on the main timeline.

Insert the path and name of your clip in place of "myMc":

//myMc keypress function:
this.myMc.onKeyDown = function():Void {
//if Up arrow is pressed
if (Key.isDown(Key.UP)) {
//add 10 to x/y scale
this._xscale = this._yscale += 10;
}
//if Down arrow is pressed
if (Key.isDown(Key.DOWN)) {
//subtract 10 to x/y scale
this._xscale = this._yscale -= 10;
}
};
//Add key listener to clip
Key.addListener(this.myMc);