按钮循环actionscript 2.0

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了按钮循环actionscript 2.0相关的知识,希望对你有一定的参考价值。

  1. var cur:Number;
  2. var played:Boolean = false;
  3.  
  4. for (x = 1; x <= 3; x++)
  5. {
  6. eval ("clip_" + x + "_mc.hit").onRelease = play_clip;
  7. }
  8.  
  9. function play_clip ()
  10. {
  11. cur = this._parent._name.charAt (5);
  12. played = true;
  13.  
  14. for (x = 1; x <= 3; x++)
  15. {
  16. if (x != cur)
  17. {
  18. eval ("clip_" + x + "_mc")._alpha = 0;
  19. eval ("clip_" + x + "_mc.hit").enabled = false;
  20. }
  21. }
  22. //this.enabled = false;
  23. this._parent.play ();
  24. if (cur == 1){
  25. pic_frames.scaleTo(233, .5, 'linear');
  26. pic_frames.xSlideTo(124, .5, 'linear');
  27. pic_frames.ySlideTo(-26.8, .5, 'linear');
  28. pic_frames.frame_2.alphaTo(20, .5);
  29. pic_frames.frame_3.alphaTo(20, .5);
  30.  
  31. }else if(cur == 2){
  32. pic_frames.scaleTo(233, .5, 'linear');
  33. pic_frames.xSlideTo(-500, .5, 'linear');
  34. pic_frames.ySlideTo(-117, .5, 'linear');
  35. pic_frames.frame_1.alphaTo(20, .5);
  36. pic_frames.frame_3.alphaTo(20, .5);
  37. }else{
  38. pic_frames.scaleTo(233, .5, 'linear');
  39. pic_frames.xSlideTo(-1119, .5, 'linear');
  40. pic_frames.ySlideTo(-26.8, .5, 'linear');
  41. pic_frames.frame_2.alphaTo(20, .5);
  42. pic_frames.frame_1.alphaTo(20, .5);
  43. }
  44.  
  45. if(played && this._parent._parent._parent.instruction_mc._alpha != 0)
  46. {
  47. this._parent._parent._parent.instruction_mc.alphaTo(0, .5);
  48. }
  49. else
  50. {
  51. //do nothing;
  52. }
  53. }
  54.  
  55. function reset ()
  56. {
  57. pic_frames.scaleTo(100, .5, 'linear');
  58. pic_frames.xSlideTo(-12.1, .5, 'linear');
  59. pic_frames.ySlideTo(24.4, .5, 'linear');
  60. pic_frames.frame_1.alphaTo(100, .5);
  61. pic_frames.frame_2.alphaTo(100, .5);
  62. pic_frames.frame_3.alphaTo(100, .5);
  63. for (x = 1; x <= 3; x++)
  64. {
  65. eval ("clip_" + x + "_mc").gotoAndStop (1);
  66. eval ("clip_" + x + "_mc")._alpha = 100;
  67. eval ("clip_" + x + "_mc.hit").enabled = true;
  68. }
  69. }
  70. clip_1_mc.input_animation.enter_btn.onRelease = function() {
  71. trace(clip_1_mc.input_animation.input_txt.text);
  72. };

以上是关于按钮循环actionscript 2.0的主要内容,如果未能解决你的问题,请参考以下文章

ActionScript 2.0按钮onclick无法正常工作

ActionScript 2.0 - 数值效果结尾

Actionscript 2.0 if 和 else 功能不起作用?

ActionScript 2.0 和 ActionScript 3.0 有啥区别

ActionScript 2.0 和 swc

在 ActionScript 2.0 中轻松拖放