FMX-Dependent Menus II

Hi everyone :stuck_out_tongue: !
I still can’t figure out what is wrong.
For those who didn’t read Dependent Menus I read the following (others jump to 2):

  1. I have an external movie that has a menu. This movie is loaded inside the main movie inside a movieclip (let’s say menu_holder). This movie loads other external movies inside another movieclip inside the main movie (let’s call it content_holder). The menus (mcs) are dependent which means that all have an active and inactive states. When one is clicked the others are inactivated. Every menu loads a movie (in content_holder) and has a for (loop) function that inactivates the rest of the menus. Both functions interfere somehow.

  2. The first time any of the buttons are clicked they load the corresponding movie properly (in content_holder) but not the second. And I can’t figure out why. Here is the code in the menu buttons:
    ///////////////////////////////////////////////////////////////////////////////////////////////
    on(press){
    loadMovie(“portfolio/templates/2pics.swf”, “_root.c_holder”, “GET”);
    unloadMovie("_root.i_holder");
    _global.picNum=9;
    _global.path = “portfolio/interiors/01/”;
    _global.pic1=1;
    _global.pic2=2;

for(x=1; x<_global.menuIntNum; ++x){
allMenus=_parent[“n”+x];
allMenus.gotoAndStop(“inactive”);
}
this.gotoAndStop(“active”);
}
//////////////////////////////////////////////////////////////////////////////////////////////
So…Why in the world the for function is interfering with that loadMovie not loading the movie the second time the button is clicked but inactivating the other menus correctly???
////////////////////////////////////////////////////////////////////////////////////////////
NOTE: if I remove the for function from all the menus (so inactivation of menus is disabled) that doesn’t happen, the movies are loaded over and over (in content_holder) just fine.

thank u!!!
PS: I can upload the movies if anyone needs to get more into it :P.

sorry…I actually positioned the loadMovie right before the for function…not at the beginning like code in the first thread.
sorry :stuck_out_tongue:

here’s the error message when clicked the second time:

Error opening URL “file:///whateverpath/portfolio/templates/2pics.swf?x=4&allMenus=%5Flevel0%2Em%5Fholder%2En3”

nobody can help here? come on! I know there are some GURUS out there!!!
some FEEDBACK please!!!

Ok people…I finally figured it out…it doesn’t make much sense to me but here is the code that works now:

on(press){
unloadMovie("_root.i_holder");
_global.picNum=9;
_global.path = “portfolio/interiors/01/”;
_global.pic1=1;
_global.pic2=2;
loadMovie(“portfolio/templates/2pics.swf”, “_root.c_holder”, “GET”);

for(_global.z=1; _global.z<_global.menuIntNum; ++_global.z){
_global.allMenus=_parent[“n”+_global.z];
_global.allMenus.gotoAndStop(“inactive”);
}
this.gotoAndStop(“active”);
}

I just had to make the z variable global instead of local. The MenuIntNum variable just adds more flexibility in order to change the number of total menus.