使用 TweenMax 完成 gotoAndStop
我试图让 onComplete (在本例中为第 5 帧)在一系列动画之后跳到给定的帧。这是我到目前为止所写的内容。这不应该起作用吗?
stop();
import gs.TweenMax;
import gs.plugins.*;
TweenPlugin.activate([DropShadowFilterPlugin]);
import fl.motion.easing.*;
TweenMax.from (redSquare_mc, 1, {x: 285, alpha: .5, scaleX:.5 } );
TweenMax.to(redSquare_mc, 1, {dropShadowFilter:{color:0x000000, alpha:0.5, blurX:17, blurY:18, angle:45, distance:5}});
function firstFrame():void
{
TweenMax.from (yellowCircle_mc, 3, {x: 600, scaleX: 1, scaleY: 1, alpha: 1, delay: .125})
TweenMax.to (yellowCircle_mc, 3, {x: 300, scaleX: .5, scaleY: .5, alpha: .5, ease:Back.easeInOut, delay: 2, onComplete: toNextFrame});
}
firstFrame();
function toNextFrame():void
{
gotoAndStop("5");
}
I'm trying to get onComplete (frame 5 in this case) to skip to a given frame after a series of animations. Here is what i have written so far. Shouldn't this work?
stop();
import gs.TweenMax;
import gs.plugins.*;
TweenPlugin.activate([DropShadowFilterPlugin]);
import fl.motion.easing.*;
TweenMax.from (redSquare_mc, 1, {x: 285, alpha: .5, scaleX:.5 } );
TweenMax.to(redSquare_mc, 1, {dropShadowFilter:{color:0x000000, alpha:0.5, blurX:17, blurY:18, angle:45, distance:5}});
function firstFrame():void
{
TweenMax.from (yellowCircle_mc, 3, {x: 600, scaleX: 1, scaleY: 1, alpha: 1, delay: .125})
TweenMax.to (yellowCircle_mc, 3, {x: 300, scaleX: .5, scaleY: .5, alpha: .5, ease:Back.easeInOut, delay: 2, onComplete: toNextFrame});
}
firstFrame();
function toNextFrame():void
{
gotoAndStop("5");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将
gotoAndStop("5")
更改为gotoAndStop(5)
。该函数采用数字参数作为帧编号,使用字符串参数作为帧标签。Change
gotoAndStop("5")
togotoAndStop(5)
. The function takes Number arguments for frame numbers and String arguments for frame labels.您必须在函数上发送参数数组才能完美工作。
you have to send param array on function to work perfectly.