//這兩個一定要加唷~要不然Tween的指令就沒效了

import mx.transitions.Tween;
import mx.transitions.easing.*;


new Tween(目標,改變之屬性,效果,起始值,結束值,持續時間,單位);

//Back運動模式
mc1.onPress = function() {
    new Tween(mc1, "_y", Back.easeOut, mc1._y, 300, 2, true);
};

//Bounce運動模式
mc2.onPress = function() {
    new Tween(mc2, "_y", Bounce.easeOut, mc2._y, 300, 2, true);
};

//Elastic運動模式
mc3.onPress = function() {
    new Tween(mc3, "_y", Elastic.easeOut, mc3._y, 300, 2, true);
};

//Regular運動模式
mc4.onPress = function() {
    new Tween(mc4, "_y", Regular.easeOut, mc4._y, 300, 2, true);
};

//Strong運動模式
mc5.onPress = function() {
    new Tween(mc5, "_y", Strong.easeOut, mc5._y, 300, 2, true);
};

//None運動模式
mc6.onPress = function() {
    new Tween(mc6, "_y", None.easeNone, mc6._y, 300, 2, true);
    new Tween(mc6, "_alpha", None.easeNone, 100, 0, 2, true);
};

 

 

//當Tween跑完時,我們還可以多加一個Tween完成後要執行的動作,如下:

_root.A1_mc.A1_mc.onRollOver = function() {
    A1_mc.tween = new mx.transitions.Tween(A1_mc, "_x", Regular.easeOut, A1_mc._x, A1_MX, speed, true);
    A1_mc.tween.onMotionFinished = Re1;
};


Re1 = function () {
    A1_mc.tween = new mx.transitions.Tween(A1_mc, "_x", Regular.easeOut, A1_mc._x, A1X, speed1, true);
};

 

arrow
arrow
    全站熱搜

    gcchiou 發表在 痞客邦 留言(1) 人氣()