Global variable help!

I have a button that i would like to enable and disable a function within my game.

the button is called "flashBang"

I’m thinking this may need to be done with global variables to make the switch do this procedure.

How would i go about scripting this variable???

Also i want to be able to target this function during gameplay, if this function is enabled do this line of code - _root.gotoAndPlay(“flash”);

The code needs to fit somewhere in here i guess.

//hitTest top + bottom wall
if (_root.ball.hitTest(_root.topwall) or _root.ball.hitTest(
_root.bottomwall)) {
_root.yspeed = -_root.yspeed;
_root.audio.gotoAndPlay(“flash_bang”);

ANY HELP WOULD BE GREAT,
Cheers
Peter.D