A Boolean property or variable is one that can have only two possible values: true and false. It can not have any other values.
One property of a movie clip that is Boolean is the visible property. In this movie we change the visible property of the car each time we click the button.
Download the flash file
The code is shown below:
btnShow.addEventListener(MouseEvent.CLICK,showCar);
function showCar(e:MouseEvent):void {
car.visible=!car.visible; // ! means not: Make the visible property the opposite of what it is now
}
Notice the exclamation point. In ActionScript ! means not. The statement car.visible=!car.visible; means to make the visiblity the opposite of its current value.
Another Boolean property for movie clips is the buttonMode. The statement below will make the cursor change to a hand when you move over the car. Usually you only set buttonMode to true when something will happen when you click the movie clip.
car.buttonMode=true;

car.buttonMode=true;
car.addEventListener(MouseEvent.CLICK,flipCar);
btnShow.addEventListener(MouseEvent.CLICK,showCar);
function showCar(e:MouseEvent):void {
car.visible=!car.visible; // ! means not: Make the visible property the opposite of what it is now
}
function flipCar(e:MouseEvent):void {
car.scaleX=-1*car.scaleX; // flip the car on the X axis
}