flash code/robert penner

andehlu

this modern love
Do any of you guys use Robert Penner's OO code for building actionscript functions? If you dont, and you feel like you want to really learn OO actionscript check this guy out and his book. http://www.robertpenner.com If you do, let me know, I have a question. hahahha.
 
object oriented. Penner wrote a bunch of Object Oriented actionscript classes which you include into your .fla and can use when building functions.... example a dynamic tween would look like...

varname = new Tween (yourObject, "_x", Math.easeInQuad, yourObject._x, 100, 5 );

yourObject = a movieclip you want to control
"_x" = the axis you want to tween (could be any object handler like _alpha)
Math.easeInQuad = the easing of the tween ( alot of neat easing options that arent built into flash)
yourObject._x = the start point
100 = where to tween to
5 = time to tween in seconds or frames

This really allows you to build function based easily. If you make a global function with these easy tweens it insane what you can do. You can make all parts of the new Tween dynamic if you pass them as paramaters to the function...

http://www.enterthechapel.com/test/site.html <-- this is an example of what i started using all penners classes and absolutely no timeline tweens.
 
Interesting. I have been teaching myself actionscript (mainly object orientated stuff) recently. Up until this point I was simply tweening and easing everything until I eventually hit a brick wall with it and really needed to start using AS more. I'm slowly starting to understand it better.

In what way is Robert Penner's approach different?

Ian
 
It not that his approach any better than anyone else's its just that he has released these scripts for the world to use and the ppl that usde them swear by them. I just started using them last week and know that I will never tween again. I made an example for you guys at:

http://www.enterthechapel.com/test/penner_example/movie.html

There is no tween anywhere in that simple movie. It shows off one of the bounce tweens that is not available to flash natively. I made a zip with all the scripts and the fla of that example.

http://www.enterthechapel.com/test/penner_example/penner_kills_it.zip

This is just a basic example that took me 10 mins to push out. Once you get comfy with the scripts and what you can do with them, youll be loving actionscript.
 
Back
Top