Advertisement
Braber01

addEventListener Not Working

Jul 1st, 2011
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //{ REGION AS3:FRAME 1
  2. import flash.media.Sound;
  3.  
  4. stop(); //stop the time line
  5.  
  6. var soundClip:Sound;
  7. var soundChannel:SoundChannel = new SoundChannel();
  8.  
  9. function init():void {
  10.     soundClip = new Sound();
  11.     soundClip.load(new URLRequest(".\\Wheel of Fortune.mp3")); //Load Sound
  12.     soundClip.addEventListener(Event.COMPLETE,soundLoaded);
  13. }//end init()
  14.  
  15. init();
  16.  
  17. function soundLoaded(e:Event):void {
  18.     soundChannel = soundClip.play(); //Play sound
  19. }//end soundLoaded
  20.  
  21. txtWheel.text = "";
  22. this.aussie_btn.addEventListener(MouseEvent.ROLL_OVER,aussieMouseOver);
  23. this.aussie_btn.addEventListener(MouseEvent.ROLL_OUT,aussieMouseOut);
  24. this.aussie_btn.addEventListener(MouseEvent.CLICK,aussieClick);
  25.  
  26. this.bigMoney_btn.addEventListener(MouseEvent.ROLL_OVER,moneyMouseOver);
  27. this.bigMoney_btn.addEventListener(MouseEvent.ROLL_OUT,moneyMouseOut);
  28. this.bigMoney_btn.addEventListener(MouseEvent.CLICK,moneyClick);
  29.  
  30. this.finland_btn.addEventListener(MouseEvent.ROLL_OVER,finlandMouseOver);
  31. this.finland_btn.addEventListener(MouseEvent.ROLL_OUT,finlandMouseOut);
  32. this.finland_btn.addEventListener(MouseEvent.CLICK,finlandClick);
  33.  
  34.  
  35. this.gameboy_btn.addEventListener(MouseEvent.ROLL_OVER,gameboyMouseOver);
  36. this.gameboy_btn.addEventListener(MouseEvent.ROLL_OUT,gameboyMouseOut);
  37. this.gameboy_btn.addEventListener(MouseEvent.CLICK,gameboyClick);
  38.  
  39. this.nes_btn.addEventListener(MouseEvent.ROLL_OVER,nesMouseOver);
  40. this.nes_btn.addEventListener(MouseEvent.ROLL_OUT,nesMouseOut);
  41. this.nes_btn.addEventListener(MouseEvent.CLICK,nesClick);
  42.  
  43. this.phillipine_btn.addEventListener(MouseEvent.ROLL_OVER,phillipneMouseOver);
  44. this.phillipine_btn.addEventListener(MouseEvent.ROLL_OUT,phillipneMouseOut);
  45. this.phillipine_btn.addEventListener(MouseEvent.CLICK,phillipneClick);
  46.  
  47. this.french_btn.addEventListener(MouseEvent.ROLL_OVER,frenchMouseOver);
  48. this.french_btn.addEventListener(MouseEvent.ROLL_OUT,frenchMouseOut);
  49. this.french_btn.addEventListener(MouseEvent.CLICK,frenchClick);
  50.  
  51. this.turnTable_btn.addEventListener(MouseEvent.ROLL_OVER,turntableMouseOver);
  52. this.turnTable_btn.addEventListener(MouseEvent.ROLL_OUT,turntableMouseOut);
  53. this.turnTable_btn.addEventListener(MouseEvent.CLICK,turntableClick);
  54.  
  55. this.uk_btn.addEventListener(MouseEvent.ROLL_OVER,ukMouseOver);
  56. this.uk_btn.addEventListener(MouseEvent.ROLL_OUT,ukMouseOut);
  57. this.uk_btn.addEventListener(MouseEvent.CLICK,ukClick);
  58.  
  59. function aussieMouseOver(e:MouseEvent):void {
  60.     txt_Wheel.text = "Aussie Wheel";
  61. }//end aussieMouseOver
  62. function aussieMouseOut(e:MouseEvent):void {
  63.     txt_Wheel.text = "";
  64. }//endaussieMouseOut
  65. function aussieClick(e:MouseEvent):void {
  66.     soundChannel.stop();
  67.     gotoAndStop("mnu_Aussie");
  68. }//endAussieClick
  69.  
  70. function moneyMouseOver(e:MouseEvent):void {
  71.     txt_Wheel.text = "Big Money Wheel";
  72. }//end moneyMouseOver
  73. function moneyMouseOut(e:MouseEvent):void {
  74.     txt_Wheel.text = "";
  75. }//end moneyMouseOut
  76. function moneyClick(e:MouseEvent):void {
  77.     soundChannel.stop();
  78.     gotoAndStop("mnu_BigMoney");
  79. }//end moneyClick
  80.  
  81. function finlandMouseOver(e:MouseEvent):void {
  82.     txt_Wheel.text = "Finnish Wheel";
  83. }//endfinlandMouseOver
  84. function finlandMouseOut(e:MouseEvent):void {
  85.     txt_Wheel.text = "";
  86. }//end finlandMouseOut
  87. function finlandClick(e:MouseEvent):void {
  88.     soundChannel.stop();
  89.     gotoAndStop("mnu_Finnish");
  90. }
  91.  
  92. function gameboyMouseOver(e:MouseEvent):void {
  93.     txt_Wheel.text = "Gameboy Wheel";
  94. }
  95. function gameboyMouseOut(e:MouseEvent):void {
  96.     txt_Wheel.text = "";
  97. }
  98. function gameboyClick(e:MouseEvent):void {
  99.     soundChannel.stop();
  100.     gotoAndStop("mnu_Gameboy");
  101. }
  102.  
  103. function nesMouseOver(e:MouseEvent):void {
  104.     txt_Wheel.text = "NES Wheel";
  105. }
  106. function nesMouseOut(e:MouseEvent):void {
  107.     txt_Wheel.text = "";
  108. }
  109. function nesClick (e:MouseEvent):void {
  110.     soundChannel.stop();
  111.     gotoAndStop("mnu_NES");
  112. }
  113.  
  114. function phillipneMouseOver(e:MouseEvent):void {
  115.     txt_Wheel.text = "Phillipno Wheel";
  116. }
  117. function phillipneMouseOut(e:MouseEvent):void {
  118.     txt_Wheel.text = "";
  119. }
  120. function phillipneClick(e:MouseEvent):void {
  121.     soundChannel.stop();
  122.     gotoAndStop("mnu_Phillipno");
  123. }
  124.  
  125. function frenchMouseOver(e:MouseEvent):void {
  126.     txt_Wheel.text = "French Wheel";
  127. }
  128. function frenchMouseOut(e:MouseEvent):void {
  129.     txt_Wheel.text = "";
  130. }
  131. function frenchClick(e:MouseEvent):void {
  132.     soundChannel.stop();
  133.     gotoAndStop("mnu_French");
  134. }
  135.  
  136. function turntableMouseOver(e:MouseEvent):void {
  137.     txt_Wheel.text = "US Wheel";
  138. }
  139. function turntableMouseOut(e:MouseEvent):void {
  140.     txt_Wheel.text = "";
  141. }
  142. function turntableClick(e:MouseEvent):void {
  143.     soundChannel.stop();
  144.     gotoAndStop("mnu_US");
  145. }
  146.  
  147. function ukMouseOver(e:MouseEvent):void {
  148.     txt_Wheel.text = "UK Wheel";
  149. }
  150. function ukMouseOut(e:MouseEvent):void {
  151.     txt_Wheel.text = "";
  152. }
  153. function ukClick(e:MouseEvent):void {
  154.     soundChannel.stop();
  155.     gotoAndStop("mnu_UK");
  156. }
  157. //} ENDREGION AS3:FRAME 1
  158.  
  159. //{ REGION AS3:FRAME 2
  160. //Aussie Wheel of Fortune Player Select
  161. @@ this.btn_Aussie1Player.addEventListener(MouseEvent.CLICK,aussie1Player);
  162. @@ this.btn_Aussie2Player.addEventListener(MouseEvent.CLICK,aussie2Player);
  163. @@ this.btn_Aussie3Player.addEventListener(MouseEvent.CLICK,aussie3Player);
  164.  
  165. function aussie1Player(e:MouseEvent):void {
  166.     gotoAndStop("Aussie1Player");
  167. }
  168. function aussie2Player(e:MouseEvent):void {
  169.     gotoAndStop("Aussie2Player");
  170. }
  171. function aussie3Player(e:MouseEvent):void {
  172.     gotoAndStop("Aussie3Player");
  173. }
  174. //} ENDREGION AS3:FRAME 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement