The second problem is you are having hitting = false every frame. Move that line of code from above cntr = 0; to onClipEvent(load) Then it will work fine.