Forcing timeline to continue anyway if not triggered by user (AS2)
I am making an interactive ad and I have a button mc in flash using
ActionScript 2 which when dragged to a target triggers the rest of the
timeline to play the animation. But what I would like to do in addition to
this is force the animation to play anyway after 10 seconds incase the
user decides not to click and drag.
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;
}
};
};
This may have a simple answer but I am still learning the basics of AS.
Thanks!
No comments:
Post a Comment