Flash不是很了解,请大家帮我看看。
借了韩国的一个效果,自己做了一下,但是那些按钮我只能让他们点击后一直显示btn的第二帧。我现在想让它点击后,然后其他按钮gotoAndStop第一帧,自己保持在第二帧。
请各位帮我看看代码,谢谢!
Stage.scaleMode = "noScale";
counter = 1;
max = 10;
num = 19;
for (i = 1; i <= num; i++)
{
mc = this.attachMovie("btn", i, i);
mc._x = (i - 1) % 6 * 18 + 76;
mc._y = Math.floor((i - 1) / 6) * 18 + 100;
mc.onPress = function ()
{
this.gotoAndStop(2);
};
mc.onRollOut = function ()
{
this.gotoAndStop(1);
};
mc.onRollOver = function ()
{
this.gotoAndStop(2);
};
mc.onRelease = function ()
{
this.gotoAndStop(2);
this._parent.attachMovie("preloader", "preloader", 1000);
preloader._x = 245;
preloader._y = 170;
preloader.bar._xscale = 0;
for (j = 1; j <= max; j++)
{
mask[j].removeMovieClip();
} // end of for
counter = 1;
image.loadMovie("imageSample01/" + this._name + ".jpg");
this.onEnterFrame = function ()
{
this.temp1 = image.getBytesLoaded();
this.temp2 = image.getBytesTotal();
preloader.bar._xscale = this.temp1 / this.temp2 * 100;
if (this.temp1 == this.temp2)
{
preloader.removeMovieClip();
delete this["onEnterFrame"];
mask.attachMovie("rectMove", counter, counter);
image.setMask(mask);
} // end if
};
};
} // end of for
this.attachMovie("preloader", "preloader", 1000);
preloader._x = 280;
preloader._y = 170;
preloader.bar._xscale = 0;
image.loadMovie("imageSample01/1.jpg");
this[1].onEnterFrame = function ()
{
this.temp1 = image.getBytesLoaded();
this.temp2 = image.getBytesTotal();
preloader.bar._xscale = this.temp1 / this.temp2 * 100;
if (this.temp1 == this.temp2 && this.temp1 > 200)
{
preloader.removeMovieClip();
delete this["onEnterFrame"];
mask.attachMovie("rectMove", counter, counter);
image.setMask(mask);
} // end if
};
this[1].gotoAndStop(3);
附件!请点击
下载