LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-10-2002, 02:48 PM
shaggy shaggy is offline
Registered User
 
Join Date: Dec 2002
Posts: 6
Rep Power: 0
shaggy is on a distinguished road
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;
      }
   }
}
zoomX and zoomY are variables that set the "zoom" in percentage like 200 or 300

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.
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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




All times are GMT. The time now is 01:08 PM.