Home Tutorials Forums Articles Blogs Movies Library Employment Press

 ActionScript.org Forums RATIO-nal Easing
 Register FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

 03-10-2004, 11:07 PM #11 thaumaturgy Macromedia Mercenary     Join Date: Feb 2004 Location: Rose Bowl Country Posts: 300 Did you ever know that you're my heeeerrroooooooo.... Seriously, that's just some next level isht. Now if I could only apply it to my projects...
 03-11-2004, 01:55 AM #12 thaumaturgy Macromedia Mercenary     Join Date: Feb 2004 Location: Rose Bowl Country Posts: 300 Oh, question: What do the values "r" "p" and "f" stand for in your equations? r = ratio p = power (exponential?) f = function? Also: How does the value of "f" affect the final easing output?
 03-11-2004, 02:38 AM #13 pixelwit village halfwit     Join Date: Jul 2001 Location: USA, PA Posts: 3,330 Yes, R, P, and F stand for Ratio, Power and Function. Sometimes Power is exponential, sometimes it isn't, it depends what easing equation (ezSine, ezExpo... etc.) you're using. The easing equations are generally just ways of describing a curve. In one of the examples I previously provided I traced out the results for values between zero and one in .1 increments. the results could easily be plotted on a 10 by 10 grid. Imagine the input value (a .1 increment) as your step in the X direction and the returned value as a step in the Y direction. It might look something like this in ActionScript: PHP Code: ``` lineStyle(0); gridSize = 400; steps = 100; for(var i=0; i<=steps; i++){     var x = i*(gridSize/steps);// constant rate     var y = Math.easeIn(i/steps)*gridSize; // eased rate     lineTo(x, y); }  ``` Which easing function you use determines the curvature of the line. Hope it helps, -PiXELWiT http://www.pixelwit.com __________________ There are no answers, only choices.
 03-11-2004, 04:09 AM #14 thaumaturgy Macromedia Mercenary     Join Date: Feb 2004 Location: Rose Bowl Country Posts: 300 I see now. Thanks!
 03-11-2004, 03:08 PM #15 boyzdynasty Senior Member     Join Date: Aug 2002 Location: Philly Posts: 2,583 i'm trying to test the code...copied and paste...but I get an error "Math.easeIn...." and all the functions not recognize. What can I do to fix this? __________________ I need a new signature!
 03-11-2004, 03:13 PM #16 splict spend my time in blender     Join Date: Oct 2003 Location: tampa, fl Posts: 1,138 are you using mx2004? if so, don't forget to change to AS1 in your publish profile. btw, nice work, pixelwit. __________________ Certified Flash MX 2004 Developer
 03-11-2004, 04:46 PM #17 boyzdynasty Senior Member     Join Date: Aug 2002 Location: Philly Posts: 2,583 oh that is really nice. __________________ I need a new signature! Last edited by boyzdynasty; 03-11-2004 at 04:49 PM.
 03-11-2004, 06:28 PM #18 pixelwit village halfwit     Join Date: Jul 2001 Location: USA, PA Posts: 3,330 I haven't really gotten into AS2 (waiting for Moock's new book) but I've looked at a few examples of class definitions and here's what I came up with: PHP Code: ``` class com.pixelwit.ease{     static function easeIn (r:Number, p:Number, f:function):Number{         if(p == undefined) p = 2;         if(f == undefined)f = Math.pow;         return f(r, p);     }     static function easeOut (r:Number, p:Number, f:function):Number{         return 1-easeIn(1-r, p, f);     }     static function easeInOut (r:Number, p:Number, f:function):Number{         if(r<.5)return easeIn(r*2, p, f)/2;         return .5+easeOut((r-.5)*2, p, f)/2;     }     static function ezExpo (r:Number, p:Number):Number{         if(r==0 || r==1) return r;         if(p<2)p = 2;         return Math.pow(p, 10*(r-1));     }     static function ezCirc (r:Number, p:Number):Number{         r = -(Math.sqrt(1-r*r)-1);         if(p>1) return easeIn(r, --p, ezCirc);         return r;     }     static function ezSine (r:Number, p:Number):Number{         r = 1-Math.cos(r*Math.PI/2);         if(p>1) return easeIn(r, --p, ezSine);         return r;     } }  ``` If anyone familiar with AS2 has anything to add or can brief me on how to implement such a class definition in MX04 I'd appreciate it. -PiXELWiT http://www.pixelwit.com __________________ There are no answers, only choices. Last edited by pixelwit; 03-11-2004 at 06:49 PM.

 Thread Tools Display Modes Rate This Thread Linear Mode Rate This Thread: 5 : Excellent 4 : Good 3 : Average 2 : Bad 1 : Terrible

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules
 Forum Jump User Control Panel Private Messages Subscriptions Who's Online Search Forums Forums Home ActionScript Forums Group     ActionScript 3.0     ActionScript 2.0     ActionScript 1.0 (and below)     Simple Stuff (Newbies) Flash General Questions     Flash 10 General Questions     Flash 9 General Questions     Flash 8 General Questions     Other Flash General Questions Flex     Flex 2, 3 & 4     Flex 1 Extensions and Plugins     Components     JSFL - Extending Flash Desktop, Mobile and non-browser Environments     AIR (Apollo)     FlashLite / Portable Devices Development     Projectors and CDs Supporting Technologies     HTML and JavaScript     haXe     Server-Side Scripting     Flash Remoting     Flash Media Server General     Best Practices     Gaming and Game Development     Animation and Effects     Flashants Support Forum Community Boards     General Chat     Just for Kicks Challenges     Detention Flash In Action     Site Check     Cool Sites     Widgets Decommissioned     Projects and Positions CMS Forums     Announcements Board     Content Postings / Updates     Product Review Requests     CMS Technical Questions     Process Questions     Collaboration & Suggested Articles

All times are GMT. The time now is 04:50 AM.

///