0

我在 Flash 主页中设计了 5 个按钮 ,关于、个人资料、画廊,与右侧的电影剪辑符号联系。现在我想当我单击主页按钮时,影片剪辑会在右侧相同位置返回主页按钮,当我单击关于它时,它与其他按钮相同。请帮助我,让我知道如何使用动作脚本 2.0。

4

2 回答 2

0

你需要做补间。比一个例子更好,看看这个教程:

http://www.actionscript.org/resources/articles/170/1/Flash-MX-2004-Undocumented-TweenEasing-Classes-Documented/Page1.html

于 2010-12-17T18:45:58.790 回答
0

您需要更改:

var begin = 20;
var end = 380;

这些值代表舞台中球的开始和结束 X 位置。如果你有你的按钮,例如 X = 50 ; y = 100;示例应该是:

myButton_btn.onRelease = function() {
        tweenBall(mx.transitions.easing.Bounce.easeOut);
};
function tweenBall(easeType) {
        var begin_x = 470; //This should be the initial X position of the mc that you want to animate
        var end_x = 50;
        var begin_y = 100; //This should be the initial Y position of the mc that you want to animate
        var end_y = 100; 
        var time = 20;
        var mc = ball_mc;
        ballTween = new mx.transitions.Tween(mc, "_x", easeType, begin_x, end_x, time);
        ballTween = new mx.transitions.Tween(mc, "_y", easeType, begin_y, end_y, time);
}

希望能帮助到你 !!

于 2010-12-18T19:34:05.093 回答