Advertisement
HoR_somesaki

sasa_disc

Mar 24th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //專輯歌曲頁面程式設定,舞台停留此格等待使用者操作下一步
  2. import flash.events.MouseEvent;
  3. stop();
  4.  
  5. const KEY2_UP:uint = 38;
  6. const KEY2_DOWN:uint = 40;
  7. //建立鍵盤按下時的偵聽器
  8. stamp1.addEventListener(MouseEvent.CLICK,album1);
  9. function album1(event:MouseEvent)
  10. {
  11.     gotoAndPlay("ALBUM1");//前往專輯1影格
  12. }
  13. stamp2.addEventListener(MouseEvent.CLICK,album2);
  14. function album2(event:MouseEvent)
  15. {
  16.     gotoAndPlay("ALBUM2");//前往專輯2影格
  17. }
  18. stamp3.addEventListener(MouseEvent.CLICK,album3);
  19. function album3(event:MouseEvent)
  20. {
  21.     gotoAndPlay("ALBUM3");//前往專輯3影格
  22. }
  23. stamp4.addEventListener(MouseEvent.CLICK,album4);
  24. function album4(event:MouseEvent)
  25. {
  26.     gotoAndPlay("ALBUM4");//前往專輯4影格
  27. }
  28. //點擊BACK回到主頁紙花飄前一格
  29. back.addEventListener(MouseEvent.CLICK,backin2);
  30. function backin2(event:MouseEvent)
  31. {
  32.     MovieClip(root).gotoAndPlay("in");
  33. }
  34. gotoAndPlay(84,"index");
  35.  
  36. //打開專輯小視窗後每次點擊按鈕皆會跳到相應的影格,以切換按鈕已點擊後的介面樣貌
  37. //點擊//設置在影格程式MV
  38. stop();
  39.  
  40. A1.addEventListener(MouseEvent.CLICK,songA_1);
  41. function songA_1(event:MouseEvent)
  42. {
  43.     gotoAndStop("A1");
  44. }
  45. A2.addEventListener(MouseEvent.CLICK,songA_2);
  46. function songA_2(event:MouseEvent)
  47. {
  48.     gotoAndStop("A2");
  49. }
  50. A3.addEventListener(MouseEvent.CLICK,songA_3);
  51. function songA_3(event:MouseEvent)
  52. {
  53.     gotoAndStop("A3");
  54. }
  55. BACKA.addEventListener(MouseEvent.CLICK,backA1)
  56. function backA1(event:MouseEvent)
  57. {
  58.     gotoAndStop(95);
  59. }
  60.  
  61. //設置在影格程式,點擊歌詞
  62. stop();
  63.  
  64. A1.addEventListener(MouseEvent.CLICK,A2_1);
  65. function A2_1(event:MouseEvent)
  66. {
  67.     gotoAndStop("A1");
  68. }
  69. A3.addEventListener(MouseEvent.CLICK,A2_3);
  70. function A2_3(event:MouseEvent)
  71. {
  72.     gotoAndStop("A3");
  73. }
  74.  
  75. BACKA.addEventListener(MouseEvent.CLICK,backA3);
  76. function backA3(event:MouseEvent)
  77. {
  78.     gotoAndStop(95);
  79. }
  80.  
  81. stage.focus = this;
  82. stage.addEventListener(KeyboardEvent.KEY_DOWN, ly1down);
  83. stage.addEventListener(KeyboardEvent.KEY_UP, ly1up);
  84. function ly1down(event:KeyboardEvent)
  85. {
  86.     var positionY:Number=ly1.y;
  87.     //設定鍵盤變數
  88.     var code:uint = event.keyCode;
  89.     //如果按下每個鍵時會發生什麼事
  90.             if(code==KEY2_UP)
  91.             {
  92.             up_btn.gotoAndStop(2);
  93.             ly1.y+=10;
  94.             }
  95.             if(code==KEY2_DOWN)
  96.             {
  97.             down_btn.gotoAndStop(2);
  98.             ly1.y-=10;
  99.             }
  100.             if(ly1.hitTestObject(wall1)){
  101.             ly1.y=positionY;
  102.             }
  103.             if(ly1.hitTestObject(wall2)){
  104.             ly1.y=positionY;
  105.             }
  106.     }
  107.     function ly1up(event:KeyboardEvent){
  108.     //設定鍵盤變數
  109.     var code:uint = event.keyCode;
  110.     if(code==KEY2_UP){
  111.         up_btn.gotoAndStop(1);
  112.     }
  113.     if(code==KEY2_DOWN){
  114.         down_btn.gotoAndStop(1);
  115.     }
  116. }
  117.  
  118. //設置在影格程式,點擊專輯資訊
  119. import flash.events.MouseEvent;
  120. stop();
  121.  
  122. A1.addEventListener(MouseEvent.CLICK,A3_1);
  123. function A3_1(event:MouseEvent)
  124. {
  125.     gotoAndStop("A1");
  126. }
  127. A2.addEventListener(MouseEvent.CLICK,A3_2);
  128. function A3_2(event:MouseEvent)
  129. {
  130.     gotoAndStop("A2");
  131. }
  132.  
  133. BACK1.addEventListener(MouseEvent.CLICK, backA_3);
  134. function backA_3(event:MouseEvent)
  135. {
  136.     gotoAndStop(95);
  137. }
  138.  
  139. stage.focus = this;
  140. stage.addEventListener(KeyboardEvent.KEY_DOWN, pri1down);
  141. stage.addEventListener(KeyboardEvent.KEY_UP, pri1up);
  142. function pri1down(event:KeyboardEvent)
  143. {
  144.     var positionY:Number=pri1.y;
  145.     //設定鍵盤變數
  146.     var code:uint = event.keyCode;
  147.     //如果按下每個鍵時會發生什麼事
  148.             if(code==KEY2_UP)
  149.             {
  150.             up_btn.gotoAndStop(2);
  151.             pri1.y+=10;
  152.             }
  153.             if(code==KEY2_DOWN)
  154.             {
  155.             down_btn.gotoAndStop(2);
  156.             pri1.y-=10;
  157.             }
  158.             if(pri1.hitTestObject(wall1)){
  159.             pri1.y=positionY;
  160.             }
  161.             if(pri1.hitTestObject(wall2)){
  162.             pri1.y=positionY;
  163.             }
  164.     }
  165.     function pri1up(event:KeyboardEvent){
  166.     //設定鍵盤變數
  167.     var code:uint = event.keyCode;
  168.     if(code==KEY2_UP){
  169.         up_btn.gotoAndStop(1);
  170.     }
  171.     if(code==KEY2_DOWN){
  172.         down_btn.gotoAndStop(1);
  173.     }
  174. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement