0

我正在制作一个交互式广告,我在 Flash 中有一个使用 ActionScript 2 的按钮 mc,当拖动到目标时会触发时间轴的其余部分来播放动画。但除此之外我想做的是强制动画在 10 秒后播放,以防用户决定不点击和拖动。

stop();

myButton.onEnterFrame = function() {
    this._x = 23;
};
myButton.onPress = function() {
    delete this.onEnterFrame;
    startDrag(this, false, 30, this._y, 280, this._y);
    onEnterFrame = function () {
        gotoAndStop(Math.round(myButton._x - 25));
    };
};
myButton.onRelease = myButton.onReleaseOutside = function () {
    stopDrag();

    this.onEnterFrame = function() {
        this._x = _currentframe + 25;


    if (eval(this._droptarget) == target) {
    this._x += (280-this._x) * 0.5;
    }
    else {//if (eval(this._droptarget) != model) {
    this._x += (23-this._x) * 0.5;
    }


    };
};

这可能有一个简单的答案,但我仍在学习 AS 的基础知识。谢谢!

4

1 回答 1

0
var tenSecondInterval = setInterval( doThisAfterTenSeconds, 10000 );

function doThisAfterTenSeconds():Void
{
    clearInterval( tenSecondInterval );

    // respond
}
于 2013-09-10T19:17:54.827 回答