The _visible property

I looked up the property _visible on the Action SCript Reference (Shift F1 of Flash MX) and it gave me some info about it, but it didn’t give me a practical code example. Could anybody give me a small, practical code example for that, so I can see how it works?

Bellow is that the reference gave me:

MovieClip._visible

Availability

Flash Player 4.

Usage

myMovieClip._visible

Description

Property; a Booloean value that indicates whether the movie specified by the MovieClip parameter is visible. Movie clips that are not visible (_visible property set to false) are disabled. For example, a button in a movie clip with the _visible property set to false cannot be clicked.

What I’m looking for:
Would the code work if I just simply typed
myMovieClip._visible=false;
if I want an object to disapear?

Basicly, what I’m trying to do is… I have a project in which I have dots on the locations in a world map to which a certain organization is going to this year. I’m trying to get it to work with cold fusion, so that if the database on coldfusion says that we are going to that particular city this year (returning true, to Flash), than Flash makes that movie clip (on that location) visible. If it returns false, than the movie clip should disapear on that spot. I was thinking of either using the _visible property or delete. Does anyone have any ideas pertaining to how I might do that?

My logic right now is the following:

I’m picking up a variable from a text file generated by a Cold Fusion Database that says _root.myVariableWhichIsNamedMyCOuntryAndCity=true&_root.mynextVariable=false

so on…

Than it goes like…
_root.myContinentMovieClip.mycountryMovieClip.MyCityLittleTargetMovieClip._visible = myVariableWhichIsNamedMyCOuntryAndCity;

the above, I’m assuming should equal

_root.myContinentMovieClip.mycountryMovieClip.MyCityLittleTargetMovieClip._visible = true;

am I correct? Could you give me any insight? Any help?

Thank you;

Nathalia

draw a circle on the stage, convert it to a movieclip, call it ‘circle’, and have this action on the parent timeline

circle._visible = false

:slight_smile:

nathalia -

i don’t know much about coldfusion, but you could probably incorporate it into some kind of if/else statement. e.x.:

[AS]// set city variable
newYork = true;

if(newYork){
circle._visible = true;
}else{
circle._visible = false;
}
[/AS]

so, say if you were going to new york, then the variable newYork would equal true, then the if/else statement would evaluate this and take the appropriate action of either making the circle visible or invisible.

read up on if/else tests here

hope that helps! :stuck_out_tongue:

well… unless the coldfusion part of the equation is working without error… then this is a straight a/s problem. :slight_smile:

a/s problem? What is a/s?

 

Can you write it something like this aswell?

ActionScript:--------------------------------------------------------------------------------// set city variable
newYork = 1;

if(newYork){
circle._visible = 1;
}else{
circle._visible = 0;
}


Where 1 or true and 0 is false?

yea…it works