PDA

View Full Version : the _visible property



NJusticeForAll2
April 10th, 2003, 08:26 PM
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.MyCi tyLittleTargetMovieClip._visible = myVariableWhichIsNamedMyCOuntryAndCity;


the above, I'm assuming should equal

_root.myContinentMovieClip.mycountryMovieClip.MyCi tyLittleTargetMovieClip._visible = true;


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

Thank you;

Nathalia

ahmed
April 10th, 2003, 09:25 PM
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

:)

liam
April 10th, 2003, 09:34 PM
nathalia -

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

// set city variable
newYork = true;

if(newYork){
circle._visible = true;
}else{
circle._visible = false;
}


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 (http://www.kirupa.com/developer/actionscript/tricks/simpif.asp)

hope that helps! :P

upuaut
April 11th, 2003, 05:29 AM
well.. unless the coldfusion part of the equation is working without error... then this is a straight a/s problem. :)

NJusticeForAll2
April 14th, 2003, 06:58 PM
a/s problem? What is a/s?

morse
April 15th, 2003, 12:35 AM

schling
April 15th, 2003, 06:45 AM
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?

blah-de-blah
April 15th, 2003, 07:13 AM
yea....it works