[f5] Hide/show levels?

I’ve tried to find something that could help me by searching the forum, but I can’t really find what I need. I’ve got a main fla, which I load 3 swf’s into. This is done by this script in the first frame:
[AS]loadMovieNum(“meny.swf”, 10);
loadMovieNum(“boll.swf”, 11);
loadMovieNum(“introbild.swf”, 8);[/AS]
Until a variable is set, I don’t want these three swf’s to be shown. I’ve tried with this script:[AS]
_level8._visible = false;
_level10._visible = false;
_level11._visible = false;[/AS]
But this doesn’t seem to work. Is there some way to hide a level? Please help! :slight_smile:

This should work:[AS]_level1._visible = false;[/AS]

Isn’t that exactly the same script I used? I can’t get it to work… :frowning:

:-\ :-\ :-\ …

If there really ain’t any way of doing it then you could always createEmptyMovieClip(); and load the movies into them and then hide the movieclips!

Syko, I don’t think I can do that, because all the buttons and mc’s are linked to i.e. _level10.someMC._dosomething. If I put the movies inside a movieclip I would have to change all the buttons and mc’s, wouldn’t I? Like _level10.myNewMC.someMC._dosomething. Am I right or wrong?

*Originally posted by thorseye *
**Isn’t that exactly the same script I used? I can’t get it to work… :frowning: **
Yes its the same script and it works.
But if you set level3 visibility to false, and later you load a movie into that level, it becomes visible.

levels dont exist until something are loaded into them. If you call a loadMovie in the first frame and then immediately try to turn off the visibility of whatever level you just tried to load something into, nothing will happen since the level still doesnt exist. You have to wait until something is within the level so Flash can recognise there being a level before you can alter any of its characteristics such as visibility. This is simply a matter of having some frame loop check for something if (_level1) _level1._visible = false;

*Originally posted by thorseye *
**Syko, I don’t think I can do that, because all the buttons and mc’s are linked to i.e. _level10.someMC._dosomething. **

I didn’t know that : P! :stuck_out_tongue:

Listen to Sen! He knows! :wink: