Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi Does anyone know how I can do 1

Status
Not open for further replies.

coder1964

IS-IT--Management
Aug 28, 2003
29
0
0
CA
Hi

Does anyone know how I can do something like:

for each mc {
mcname._visible = false;
}

I have lots of clips that I need to hide. I want to simply hide ALL movies then show them when called.

T.I.A.
 
Several ways depending on your setup.

If your clips were numbered named (mc1, mc2, mc3, etc...), you could easily go through a for loop to make them all (or only some) invisible and/or visible again.

If it's just as a starting point, they can all be made invisible to start with, by adding the following on their first frame's...

this._visible = false;

Them simply make anyone visible when needed...

More info on your part?

Regards,

cubalibre2.gif
 
Thanks for the answer. The clips all have meaningfull names and for maintenance reasons these names will have to stay.

At all costs I want to avoid having code inside clips. Again for maintenance reasons. This is company policy as on the next release this job will be someone elses responsibility and all code must be easy to find as well as fully documented.

All primary clips lie on the root although some clips have secondary and tertiary clips nested.

Essentially I require a button which when clicked will make all clips currently on stage invisible. Sort of like a refresh button on a game.

Turning them back on depending on user interaction is a part I dont have to worry about as existing code will take care of that.

I hope that is somewhat clearer.
 
possible solution

for(item in _root)
if(typeof _root[item] == "movieclip")
_root[item]._visible = false;


try and see if thats all you need

if not then you will need some more loops

for(items in _root.mcname)
if(typeof _root[items] == "movieclip")
_root.mcname[items]._visible = false;


all code i guess could go inside a series of nested loops....if an item is a movieclip start a new loop for that clip and so on ....probably only worth doing if the number of clips is large
 
Thanks, billwatson.

The first piece of code solved the problem too well. I ended up with a blank screen !!

However I added a line to switch the navigation system back on and now I am one happy camper.

Once again you have saved me hours of time.

If you are ever in Dayton call me. I will stand you a meal and all the beer you can drink.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top