1. Home
  2. Computing & Technology
  3. Animation
photo of Adrien-Luc Sanders
Adrien-Luc's Animation Blog

By Adrien-Luc Sanders, About.com Guide to Animation since 2005

Hiding and Unhiding Movie Clips on Command Using _visible and !

Wednesday October 18, 2006
No, ! isn't the overenthusiastic punctuation to this blog's title. Instead we're referring to a logical NOT (yes, it's really customary to type it in all caps), a term used to refer to an operator in a logical function that, when placed in front of a variable or function, takes the value of that variable (or the value returned by the function) and turns it into its opposite. Confused? Look at it this way: true=true, but !true=false. If it isn't true, then it's false, so NOTtrue/!true=false. ! has turned true into its opposite.

Let's learn how to use this to hide and unhide a movie clip on command using a single button and only one script, rather than one script to hide and one to unhide.

Related Lessons:

  • ActionScripting Basics: "On" Command Options
  • ActionScripting Basics: Using setProperty
  • Comments

    October 26, 2006 at 2:07 pm
    (1) Azurice says:

    Thanks for making this tutorial (and your halloween dress-up one) as they’re exactly what I’m looking for to finish my Pirate dress-up game! =D

    October 27, 2006 at 1:32 am
    (2) animation says:

    Glad to be of service, Azurice.

    May 14, 2007 at 8:10 pm
    (3) ericssin says:

    I’m new on flash and it’s a nice tut. but there’s a small error on the displayed code there’s a missing point there:
    code on site is:
    on (release) {
    _root.pinkgirl._visible = !_root.pinkgirl_visible;
    }

    but it should be:

    on (release) {
    _root.pinkgirl._visible = !_root.pinkgirl._visible;
    }
    see? really small error it took me a while to realize that :)

    Leave a Comment

    Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

    Explore Animation
    About.com Special Features

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

    Easy ways to connect two computers for networking purposes. More >

    1. Home
    2. Computing & Technology
    3. Animation

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

    All rights reserved.