AS2 class template


/ Published in: ActionScript
Save to your folder(s)

basic template for AS2 class


Copy this code and paste it in your HTML
  1. /** Project:
  2. File: untitled
  3. Purpose:
  4. Usage:
  5. Created On: 2006-07-24
  6.  
  7. (c) 2006 Stephen.Hamilton MRM World */
  8.  
  9. //import com.ClassName
  10.  
  11. class com.untitled extends MovieClip
  12. {
  13. /** PRIVATE PROPERTIES:
  14. * ------------------- */
  15. private var _propName:String;
  16.  
  17. /** CONSTRUCTOR:
  18. * ------------ */
  19. function untitled ()
  20. {
  21. super();
  22. }
  23.  
  24. /** PUBLIC METHODS:
  25. * ---------------- */
  26. public function init(arg:Object):Void
  27. {
  28. trace("init "+this)
  29. }
  30.  
  31. /** EVENTS:
  32. * ------- */
  33. public function eventMethod(arg:String):Void
  34. {
  35. }
  36.  
  37. /** GETTERS/SETTERS:
  38. * ------- */
  39. public function set propName(arg:String):Void
  40. {
  41. _propName = arg;
  42. }
  43. public function get propName():String
  44. {
  45. return _propName
  46. }
  47.  
  48. /** PRIVATE METHODS:
  49. * ----------------*/
  50. private function cleanUp():Void
  51. {
  52. }
  53. private function privateMethod(arg:String):Void
  54. {
  55. }
  56.  
  57. /**
  58. * When movieclip and children have loaded, start application */
  59. private function onLoad():Void
  60. {
  61. }
  62. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.