
Welcome Guest
|
#1
|
|||
|
|||
|
prototype zoom function
I'm trying to create a prototype function that zoom in or out a specific object as follows:
Actionscript:
MovieClip.prototype.zoom = function (zoomX,zoomY,speedX,speedY){
this.onEnterFrame = function(){
this._xscale += (zoomX - this._xscale)/speedX;
this._yscale += (zoomY - this._yscale)/speedY;
if((Math.abs(zoomX - this._xscale))/speedX <.1 && (Math.abs(zoomY - this._yscale))/speedY < .1){
this._xscale = zoomX;
this._yscale = zoomY;
delete this.onEnterFrame;
}
}
}speedX and speedY are variables that set the speed of zooming in the x and y direcions. when i "zoom in" the function works fine, but when it try to "zoom out" the function stops after the first turn of loop. example: _root.myMovie.zoom(200,200,16,20) works fine _root.myMovie.zoom(50,50,16,20) not working can any one please find why this is happening. |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Function Consolidation Help | SpectacularStuf | Flash CS3 / Flash 9 |
0 | 09-29-2007 03:20 AM |
| Slight actionscript forum | Agent-VIP | Newbies |
0 | 05-08-2007 12:30 AM |
| Newbie! Cannot access flash.net.FileReference | paulr | Actionscript 2.0 |
7 | 12-21-2006 11:33 AM |
| Buttons ... damned BUTTONS | gooup | Flash 8 |
3 | 10-15-2006 12:31 AM |
| Functions | ssjskipp | Flash MX ActionScript |
5 | 03-22-2005 12:42 AM |





