1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application I: Setup, Skins, Canvas Color, Help File

By , About.com Guide

7 of 8

Showing and hiding the help files

With the canvas color options finished, let’s move on to the help button. The help button does only one thing: hides and unhides the movie clip containing all of the text for the help files.
on (release) {
_root.base.helptabs._visible=!_root.base.helptabs._visible
}

Again, we’re taking advantage of that logical NOT operator, avoiding the clunkiness of using if statements to test to see if the movie clip’s visibility returns true or false before changing it. Instead, whenever the help button is clicked, the help file’s movie clip becomes the opposite of what it was before. If it was visible, suddenly it isn’t. If it isn’t visible, suddenly it is. It simplifies the script down to one line of code inside a simple on (release) handler.

Explore Animation
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Deconstructing the Paint Application I: Setup, Skins, Canvas Color, Help File

©2009 About.com, a part of The New York Times Company.

All rights reserved.