Actionscript

Small Static Factory Methods

You know how Cocoa classes generally have static methods that serve as factories? return [NSArray arrayWithObjects:obj1, obj2, nil];return [NSArray arrayWithObjects:obj1, obj2, nil]; That's a dumb example, especially now that you can do @[obj1, obj2], but why not do the same in AS3? For instance: return TransactionResponse.FailedResponse();return TransactionResponse.FailedResponse(); This would replace something like: var response:TransactionResponse = […]

More

RestExpressionNode not yet implemented

Perhaps the least helpful MXMLC error message yet: public function log(level:int, message:String, ... rest):void { trace(format(level, message, ...rest)); }public function log(level:int, message:String, ... rest):void { trace(format(level, message, ...rest)); } Apparently calling a function with ...rest on accident will present this compiler error...

More

Not a Function

function myFunction(type:int):void { switch (type) { ... case AWESOME: { function doSomething():void { ... }   ...   doSomething(); } ... } }function myFunction(type:int):void { switch (type) { ... case AWESOME: { function doSomething():void { ... } ... doSomething(); } ... } } Error: doSomething is not a function.

More

Away3D 4.0-beta

I've been fooling around with the Away3d 4.0-beta lately (for FP11!). I wrote a quick demo--it's using Box2D on the XZ plane, and I'm faking the Y physics. Try it out! Arrow Keys move. Spacebar shoots. Enter jumps. If you time it right, you can jump over the wall! Link here.

More