We Recommend

Essential ActionScript 3.0 Essential ActionScript 3.0
The book focuses on the core language and object-oriented programming, but also adds a deep look at the centerpiece of Flash Player's new API: display programming. Enjoy hundreds of brand new pages covering exciting new language features, such as the DOM-based event architecture, E4X, and namespaces--all brimming with real-world sample code.


Posted By

dan_mcweeney on 08/07/08


Tagged


Versions (?)


ActiveRecord v0.1


Published in: ActionScript 3 


  1. package
  2. {
  3. import flash.utils.flash_proxy;
  4. import flash.utils.Proxy;
  5. import flash.utils.getDefinitionByName;
  6. import flash.utils.getQualifiedClassName;
  7.  
  8. public dynamic class ActiveRecord extends Proxy
  9. {
  10. public function ActiveRecord()
  11. {
  12.  
  13. }
  14. flash_proxy override function callProperty(method: *, ...args): * {
  15. try {
  16. var clazz : Class = getDefinitionByName(getQualifiedClassName(this)) as Class;
  17. return clazz.prototype[method].apply(method, args);
  18. }
  19. catch (e : Error) {
  20. return methodMissing (method, args);
  21. }
  22. }
  23. protected function methodMissing(method : *, args : Array) : Object{
  24. throw( new Error("Method Missing"));
  25. return null;
  26. }
  27. }
  28. }

Report this snippet 

You need to login to post a comment.