Guest User

Untitled

a guest
May 26th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. import us.benic.matt.App;
  2.  
  3. /**
  4. * Menu for the Flash Workflow demonstration.
  5. * @author Matt Benic
  6. */
  7. class us.benic.matt.Menu extends MovieClip
  8. {
  9. /**
  10. * Play button.
  11. */
  12. var playBtn:MovieClip;
  13.  
  14. /**
  15. * Quit button.
  16. */
  17. var quitBtn:MovieClip;
  18.  
  19. /**
  20. * The Menu instance.
  21. */
  22. private static var instance:Menu;
  23.  
  24. /**
  25. * Singleton accessor.
  26. */
  27. public static function getInstance():Menu
  28. {
  29. return instance;
  30. }
  31.  
  32. /**
  33. * Creates a new Menu and sets the singleton pointer.
  34. */
  35. public function Menu()
  36. {
  37. instance = this;
  38. }
  39.  
  40. /**
  41. * Handles an onRelease event.
  42. * @param source The MovieClip that triggered the onRelease event.
  43. */
  44. public function onButtonReleaseHandler(source:MovieClip):Void
  45. {
  46. switch(source) {
  47. case playBtn:
  48. App.getInstance().playGame();
  49. break;
  50. case quitBtn:
  51. fscommand ("quit");
  52. break;
  53. }
  54. }
  55. }
Add Comment
Please, Sign In to add comment