95Roadkill

Flash RTS Menu (WIP)

Oct 27th, 2014
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Menu Code
  2. stop();
  3. var menu:Boolean = true;
  4. var options:Boolean = false;
  5. music._visible = false;
  6. back._visible = false;
  7. sound._visible = false;
  8. soundSettings._visible = false;
  9. mBar._visible = false
  10. musicBar._visible = false
  11. var soundOptions:Boolean = false;
  12. var soundPlaying:Boolean = false;
  13. var minNum:Number = 0;
  14. var maxNum:Number = 3;
  15. buttons.stop();
  16.  
  17. start.onRelease = function()
  18. {
  19.     gotoAndPlay(5);
  20. };
  21.  
  22. sound.onRelease = function()
  23. {
  24.       menuSound.start(0,1)
  25.     if (soundOptions == true)
  26.     {
  27.         soundOptions = false;
  28.         config.gotoAndPlay(33);
  29.     }
  30.     else if (soundOptions == false)
  31.     {
  32.         soundOptions = true;
  33.         config.gotoAndPlay(2);
  34.  
  35.     }
  36. };
  37. back.onRelease = function()
  38. {
  39.     buttons.gotoAndPlay(2);
  40.     options = false;
  41.     menu = true;
  42.     back._visible = false;
  43.     sound._visible = false;
  44.     menuSound.start(0,1)
  45.     if (soundOptions == true)
  46.     {
  47.         config.gotoAndPlay(33);
  48.         soundOptions = false;
  49.     }
  50.  
  51.  
  52.  
  53. };
  54. opt.onRelease = function()
  55. {
  56.     buttons.gotoAndPlay(2);
  57.     menu = false;
  58.     options = true;
  59.     opt._visible = false;
  60.     start._visible = false;
  61.       menuSound.start(0,1)
  62.  
  63. };
  64. onEnterFrame = function ()
  65. {
  66.      menuMusic()
  67.     if (_root._currentframe == 1)
  68.     {
  69.         if (soundPlaying == false)
  70.         {
  71.             mySound.start(0,99);
  72.             soundPlaying = true;
  73.         }
  74.     }
  75.     if (buttons._currentframe == 33 && options == true)
  76.     {
  77.         back._visible = true;
  78.         sound._visible = true;
  79.     }
  80.     if (buttons._currentframe == 33 && options == false)
  81.     {
  82.         opt._visible = true;
  83.         start._visible = true;
  84.     }
  85.     if (config._currentframe >= 32 && soundOptions == false){
  86.         soundSettings._visible = false;
  87.         mBar._visible = false
  88.         musicBar._visible = false
  89.     }
  90.     if (config._currentframe == 32 && soundOptions == true){
  91.         soundSettings._visible = true;
  92.         mBar._visible = true
  93.         musicBar._visible = true
  94.        
  95.     }
  96.     sound.onRelease;
  97. };
Advertisement
Add Comment
Please, Sign In to add comment