Me.

Method Verification in Actionscript 3

ReferenceError: Error #1069: Property doSomething not found on YourObject and there is no default value. 
Look familiar?
Let’s say you want to verify an object has a method before calling that method - so flash won’t do something it shouldn’t and return a runtime error and CRASH.
SOLUTION:

public static function isMethod(object:Object, methodName:String):Boolean
{
if(object.hasOwnProperty(methodName)) return object[methodName] is Function;
return false;
}
Posted at 4pm on 03/28/10 | no comments | filed under: AS3 READ ON

Tracing out embedded fonts

One thing I’ve noticed (especially in cs4) is a hard time identifying the names of the fonts you’re embedding. For instance: the font I was using “Helvetica Neue BlackItalic” (as in the IDE) when traced turned out to be “12 pt. Helvetica* 96 Black Italic 16472″. Seriously, flash? Wow. Totally sucks. I would have never figured it out unless I did this (directly from the flash docs):
[code lang=”actionscript”]
var fontArray:Array = Font.enumerateFonts(false);
for(var i:int = 0;

Posted at 10pm on 06/18/09 | no comments | filed under: AS3 READ ON

I heart actionscript.

I heart actionscript is a site devoted to the education and sharing of all things actionscript.  These tutorials and articles are based on my experiences and problems I have encountered in my struggle to make the leap from designer to stellar coder.  I hope iHeartActionscript finds you well.

del.icio.us Slashdot Digg Facebook Technorati Google Yahoo

I heart categories.