/ Published in: ActionScript 3
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
package { import flash.utils.flash_proxy; import flash.utils.Proxy; import flash.utils.getDefinitionByName; import flash.utils.getQualifiedClassName; public dynamic class ActiveRecord extends Proxy { public function ActiveRecord() { } flash_proxy override function callProperty(method: *, ...args): * { try { var clazz : Class = getDefinitionByName(getQualifiedClassName(this)) as Class; return clazz.prototype[method].apply(method, args); } catch (e : Error) { return methodMissing (method, args); } } protected function methodMissing(method : *, args : Array) : Object{ throw( new Error("Method Missing")); return null; } } }