我正在尝试用 Flash AS3 制作一个简单的手风琴画廊。
到目前为止,我设法使画廊照片在鼠标悬停时从一个方向移动到另一个方向。我还希望画廊在没有鼠标悬停位置的情况下无限循环播放,但我无法破解逻辑以及如何做到这一点。您的帮助将不胜感激!
这是我到目前为止的 AS3 代码:
image1.addEventListener(MouseEvent.MOUSE_OVER, moove1);
function moove1(event:MouseEvent):void
{
Mouse.cursor="hand";
new Tween(image2,"x",Regular.easeInOut,image2.x,750,1,true);
new Tween(image3,"x",Regular.easeInOut,image3.x,795,1,true);
new Tween(image4,"x",Regular.easeInOut,image4.x,840,1,true);
new Tween(image5,"x",Regular.easeInOut,image5.x,885,1,true);
}
image2.addEventListener(MouseEvent.MOUSE_OVER, moove2);
function moove2(event:MouseEvent):void
{
Mouse.cursor="hand";
new Tween(image2,"x",Regular.easeInOut,image2.x,45,1,true)
new Tween(image3,"x",Regular.easeInOut,image3.x,795,1,true)
new Tween(image4,"x",Regular.easeInOut,image4.x,840,1,true)
new Tween(image5,"x",Regular.easeInOut,image5.x,885,1,true)
}
image3.addEventListener(MouseEvent.MOUSE_OVER, moove3);
function moove3(event:MouseEvent):void
{
Mouse.cursor="hand";
new Tween(image2,"x",Regular.easeInOut,image2.x,45,1,true)
new Tween(image3,"x",Regular.easeInOut,image3.x,90,1,true)
new Tween(image4,"x",Regular.easeInOut,image4.x,840,1,true)
new Tween(image5,"x",Regular.easeInOut,image5.x,885,1,true)
}
image4.addEventListener(MouseEvent.MOUSE_OVER, moove4);
function moove4(event:MouseEvent):void
{
Mouse.cursor="hand";
new Tween(image2,"x",Regular.easeInOut,image2.x,45,1,true)
new Tween(image3,"x",Regular.easeInOut,image3.x,90,1,true)
new Tween(image4,"x",Regular.easeInOut,image4.x,135,1,true)
new Tween(image5,"x",Regular.easeInOut,image5.x,885,1,true)
}
image5.addEventListener(MouseEvent.MOUSE_OVER, moove5);
function moove5(event:MouseEvent):void
{
Mouse.cursor="hand";
new Tween(image2,"x",Regular.easeInOut,image2.x,45,1,true)
new Tween(image3,"x",Regular.easeInOut,image3.x,90,1,true)
new Tween(image4,"x",Regular.easeInOut,image4.x,135,1,true)
new Tween(image5,"x",Regular.easeInOut,image5.x,180,1,true)
}
如何让图库自动循环播放?