I have a set of menus (movieclips) with 2 states: active and inactive (frame labels). I want to be able to inactivate all the menus but the one clicked. Let’s say I have 3 menus and that are called m1,m2,m3.
The syntax for m1 would be something like this: (all inactivated and then the one clicked is activated)
on(release){
for(i=1; i<4; ++i){
menu="_parent.m"+i;
menu.gotoAndStop(“inactive”);
_parent.m1.gotoAndStop(“active”);
}
//I know just doing this down here it works but I want to automate it…what if we had 30 buttons? The problem is menu.gotoAndStop(“inactive”). Menu gets the proper content in the loop…that is… _parent.m1 , _parent.m2, _parent.m3.
//_parent.m1.gotoAndStop(“active”);
//_parent.m2.gotoAndStop(“inactive”);
//_parent.m3.gotoAndStop(“inactive”);
}
Great! that worked…now some other problem related to that changed appeared:
those same menus that now work with each other create a conflict with the other actions in that same handler:
The dependent menus still work but the movie that was being loaded in the main movie inside a movieclip called c_holder is only loaded the first time the button is clicked…when you click again it doesn’t load anymore.
Note: Every menu (n1,n2,…) loads a different movie in c_holder.
oh I forgot…
if you take out the new for function of the buttons…loading the movies works fine so it’s probably related with some value created after the first click.
thanks again…
here goes the menu…you won’t really see it working (loading movies) because this is just the menu movie…not the entire site…(it would be too much)…
hopefully it’ll be enough for someone to solve it…thanx!!!
the first level navigation works (portrait, lifestyle, etc) but the numbers for every section are the ones that have that problem. Go to Interiors.
You want to load the external SWF into the MovieClip instance c_holder. The thing is, that instance doesn’t exists in the movie, so how do you expect it to load the SWF… ? :-\
Ok. Here is how it works. I didn’t attach all the files!!!
There is a main movie that has that c_holder movieclip. The main movie loads that external menu (file attached) at some point. And the numbers in that menu load another external movie in the main movie inside that movieclip. The thing works without that for() function in the numbers. It does work with the function in the menus (portrait, lifestyle, etc).
If you are still confused I could send you a link. Hope this makes sense.
Thanks.
Of course you didn’t attach all the files, I know that.
What I’m saying is that the MovieClip where the SWF should be loaded doesn’t exists!!
Just trace it. Add this line of code to the Button Actions:
[AS]trace(_root.c_holder);[/AS]
It will return undefined in the Output Window, which means that either the MovieClip is not there or the instance name is wrong.
you don’t seem to understand how it works. This movie you have is loaded inside tha main movie. So the _root. absolute path does not correspond to the main timeline of the menu but the main timeline of the main movie. Of course you can’t test that function unless you see the movie loaded in the main movie not by itself.
If you want to see it work go to: www.deborahjaffe.com (then click portfolio and that menu is loaded at the bottom, you’ll see that it works just like that).
Thanks again.
I’m sorry but I can’t do that because I don’t have that file with me right now (I’m not at work :trout: )
I thought you could take a look and see if you can guess what it is. I’ll try to post that file…:block:
hi! if someone is still there…I created dummy movies for everything to work and this is the error I get when I click on the button the second time:
Error opening URL “file:///…2pics.swf?x=4&allMenus=%5Flevel0%2Em%5Fholder%2En3”
So I don’t know how it’s getting all that extra text after 2pics.swf
Any ideas?