all groups > flash actionscript > august 2006 >
You're in the

flash actionscript

group:

Falling objects don't trigger hitTests?


Falling objects don't trigger hitTests? VaporAction
8/20/2006 7:51:03 PM
flash actionscript:
I have 2 hitTests that fail to be triggered if the object is falling when it
hits the hitTest area...and I'm using an onEnterFrame handler not
onRelease....does anyone know of any special issues with this? The falling is
done through this code...


ElementFe_mc.onRelease = function(): Void {
this.stopDrag()
this.onEnterFrame = function(): Void {
if (this._y < 409) {
this._y = this._y + 10
}
else {
delete this.onEnterFrame
}
}
Re: Falling objects don't trigger hitTests? abeall
8/20/2006 11:16:55 PM
Where's the hitTest?

Also, how are the objects falling?

Although I see neither in your code, a common problem is that if you are using
a simple hitTest onEnterFrame, then if the object if moving too fast it can
move through objects because it is never physically over top of them on a frame.
AddThis Social Bookmark Button