
I recently needed a tween that is different from the ones you see on the cheat sheet. All tweens you’ll find there have the property that the movement hardly goes outside the bounds of begin-to-endpoint (0…1). What I needed, was a tween that swings completely beyond its target, almost as far as the begin point (0…-1…1).
Posts Tagged ‘actionscript’
Custom tween in Tweener
Tuesday, August 18th, 2009Digging into CS4 perspective
Monday, July 13th, 2009I finally managed to completely copy the flash internal perspective with a manual perspective.
In flash cs4, you can make a plane, say, a 100×100 plane sitting on (0,0). Then, you can rotate it in 3D, using the properties rotationX, rotationY and rotationZ. Say you would rotate it by x and y by 20 degrees each, you end up with a nice plane in perspective.
Now this is really cool, but if would be quite a pain to display a 3D mesh in such a way.
(more…)
c# style trace
Tuesday, April 14th, 2009Hi, just a little handy AS3 snippet I thought I’d share. It simulates the string.format from dotnet in a trace statement. I decided to name it tracef like printf in c (f = format)
tracef("my location = ({0}, {1}), my name is {2}", x, y, name)
Here’s the debug function:
private function tracef(msg:String, ...arguments):void { for( var i:uint = 0; i < arguments.length; ++i ) { msg = msg.split("{"+i+"}").join(arguments[i]); } trace( msg ); }
Btw, msg’s are bad for you, at least in your food, but that’s a different story.
Dynamic Textfield with custom font
Wednesday, February 18th, 2009I noticed a little bug in flash (at least, in my version), for which I wanted to share the fix.
The bug is as follows: you create a TextField, you change it’s text and then it looks empty.
