按钮循环actionscript 2.0
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了按钮循环actionscript 2.0相关的知识,希望对你有一定的参考价值。
var cur:Number; var played:Boolean = false; for (x = 1; x <= 3; x++) { eval ("clip_" + x + "_mc.hit").onRelease = play_clip; } function play_clip () { cur = this._parent._name.charAt (5); played = true; for (x = 1; x <= 3; x++) { if (x != cur) { eval ("clip_" + x + "_mc")._alpha = 0; eval ("clip_" + x + "_mc.hit").enabled = false; } } //this.enabled = false; this._parent.play (); if (cur == 1){ pic_frames.scaleTo(233, .5, 'linear'); pic_frames.xSlideTo(124, .5, 'linear'); pic_frames.ySlideTo(-26.8, .5, 'linear'); pic_frames.frame_2.alphaTo(20, .5); pic_frames.frame_3.alphaTo(20, .5); }else if(cur == 2){ pic_frames.scaleTo(233, .5, 'linear'); pic_frames.xSlideTo(-500, .5, 'linear'); pic_frames.ySlideTo(-117, .5, 'linear'); pic_frames.frame_1.alphaTo(20, .5); pic_frames.frame_3.alphaTo(20, .5); }else{ pic_frames.scaleTo(233, .5, 'linear'); pic_frames.xSlideTo(-1119, .5, 'linear'); pic_frames.ySlideTo(-26.8, .5, 'linear'); pic_frames.frame_2.alphaTo(20, .5); pic_frames.frame_1.alphaTo(20, .5); } if(played && this._parent._parent._parent.instruction_mc._alpha != 0) { this._parent._parent._parent.instruction_mc.alphaTo(0, .5); } else { //do nothing; } } function reset () { pic_frames.scaleTo(100, .5, 'linear'); pic_frames.xSlideTo(-12.1, .5, 'linear'); pic_frames.ySlideTo(24.4, .5, 'linear'); pic_frames.frame_1.alphaTo(100, .5); pic_frames.frame_2.alphaTo(100, .5); pic_frames.frame_3.alphaTo(100, .5); for (x = 1; x <= 3; x++) { eval ("clip_" + x + "_mc").gotoAndStop (1); eval ("clip_" + x + "_mc")._alpha = 100; eval ("clip_" + x + "_mc.hit").enabled = true; } } clip_1_mc.input_animation.enter_btn.onRelease = function() { trace(clip_1_mc.input_animation.input_txt.text); };
以上是关于按钮循环actionscript 2.0的主要内容,如果未能解决你的问题,请参考以下文章
ActionScript 2.0按钮onclick无法正常工作
Actionscript 2.0 if 和 else 功能不起作用?