actionscript小问题
varonbtnNum:int;varoffbtnNum:int;varbg:MovieClip=newMovieClip();bg.graphics.beginFill...
var onbtnNum:int;
var offbtnNum:int;
var bg:MovieClip = new MovieClip();
bg.graphics.beginFill(0x999999, 1);
bg.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
bg.graphics.endFill();
bg.alpha = 0;
all.addChildAt(bg, 0);
stage.addEventListener(MouseEvent.MOUSE_OVER, overBtn);
function overBtn(evt:MouseEvent):void
{
switch (evt.target)
{
case all.bt1 :
onbtnNum = 1;
all.pic1.alpha = 1;
all.pic4.alpha = 0;
all.pic2.alpha = 0;
all.pic3.alpha = 0;
all.pic5.alpha = 1;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
case all.bt2 :
onbtnNum = 2;
all.pic2.alpha = 1;
all.pic5.alpha = 1;
all.pic1.alpha = 0;
all.pic4.alpha = 0;
all.pic3.alpha = 0;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
case all.bt3 :
onbtnNum = 3;
all.pic3.alpha = 1;
all.pic5.alpha = 1;
all.pic1.alpha = 0;
all.pic2.alpha = 0;
all.pic4.alpha = 0;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
case all.bt4 :
onbtnNum = 4;
all.pic5.alpha = 1;
all.pic4.alpha = 1;
all.pic1.alpha = 0;
all.pic2.alpha = 0;
all.pic3.alpha = 0;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
}
}
实现了鼠标移上去触发切换图片的效果,但是现在要求图片还能自动过段时间切换,应该怎么做,谢谢了 展开
var offbtnNum:int;
var bg:MovieClip = new MovieClip();
bg.graphics.beginFill(0x999999, 1);
bg.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
bg.graphics.endFill();
bg.alpha = 0;
all.addChildAt(bg, 0);
stage.addEventListener(MouseEvent.MOUSE_OVER, overBtn);
function overBtn(evt:MouseEvent):void
{
switch (evt.target)
{
case all.bt1 :
onbtnNum = 1;
all.pic1.alpha = 1;
all.pic4.alpha = 0;
all.pic2.alpha = 0;
all.pic3.alpha = 0;
all.pic5.alpha = 1;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
case all.bt2 :
onbtnNum = 2;
all.pic2.alpha = 1;
all.pic5.alpha = 1;
all.pic1.alpha = 0;
all.pic4.alpha = 0;
all.pic3.alpha = 0;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
case all.bt3 :
onbtnNum = 3;
all.pic3.alpha = 1;
all.pic5.alpha = 1;
all.pic1.alpha = 0;
all.pic2.alpha = 0;
all.pic4.alpha = 0;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
case all.bt4 :
onbtnNum = 4;
all.pic5.alpha = 1;
all.pic4.alpha = 1;
all.pic1.alpha = 0;
all.pic2.alpha = 0;
all.pic3.alpha = 0;
all.shadowmc.alphaoff.addTarget(all.pic5,1);
break;
}
}
实现了鼠标移上去触发切换图片的效果,但是现在要求图片还能自动过段时间切换,应该怎么做,谢谢了 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询