I have a drag and drop ball that begins with a 3 bounce animation. On hitTest with a basketball net it loads a subSWF called youWin2 into an empty movieclip called mySUB.
Because “dunking” the ball allows the ball to bounce 3 more times, it seems like the bounces appear to be triggering a reloading of my subSWF. The effect is of a blinking subSWF until the ball stops. It is as if the secondary bouncing is triggering additional hitTests. Does anyone have any ideas what might be causing the reloading of youWin2.swf?
on(press) {
this._freefall = false;
this._momentumY = 0;
this.startDrag(false);
}
on(release, releaseOutside) {
this._freefall = true;
this.stopDrag();
}
onClipEvent(load) {
this._freefall = true;
this._momentumY = 0;
this._accelerationY = 2.0;
this._floorElasticity = 0.75;
this._floorY = 290;
this._bounceThreshold = 3;
}
onClipEvent(enterFrame) {
if (this._freefall) {
this._y += this._momentumY;
this._momentumY += this._accelerationY;
// bounce it off the floor if it has hit it
if (this._y > this._floorY) {
this._y = this._floorY;
this._momentumY = -(this._momentumY * this._floorElasticity) + this._bounceThreshold;
// keep it from jiggling infinitely
if (Math.abs(this._momentumY) <= this._bounceThreshold) {
this._momentumY = 0;
}
}
}
}
onClipEvent(enterFrame) {
if(this.hitTest(_root.net_mc)){
_root.mySUB.loadMovie("youWin2.swf");
_root.net_mc.gotoAndPlay("net");
delete this.onEnterFrame
}
}