Several ways to do this.
System:Layer is visible(X) by itself, or do the same giving an object's LayerNumber. ie System Layer is visible(Sprite.LayerNumber)
You can also group the input events in a Group and disable the group when the layer is not visible.