[FONT=verdana, arial, helvetica][SIZE=2]I have a previous project which was designed in Flash MX 2004 and I am wishing to use CS3 and move from Flash Player 7 to Flash Player 9.
I had some code which depending on what user logged in would check their status in the database and load the respective swf. The respective swf would then access previously declared global variables to determine which other swfs to load.
My previous code for the first swf was as follows:
// These global variables are retrieved when the user logs on
_global.sSelectMC = this.myMC;
_global.nUserID = this.myID;
// This code determines the necessary swf to load
if(_root.main == undefined){
_root.createEmptyMovieClip(“main”, 0);
}
_root.main.setDepthBelow(_root.mc_frame);
_root.main.loadMovie(“flash_mx/”+sSelectMC+".swf");
_root.main.preloader(_root.preloaderTxt, mc_bar, “loading”, callBack);
Now the loaded swf then needs to read the nUserID variable when it is loaded.
Now for some bizarre reason I noticed a combobox which was used before as a shared library component located in the primary swf, but not on any stage but with all the linkage attributes set to share for other swfs.
Now if I leave the combobox shared the filesize is 60Kb and all my global variables work, but if I remove the combobox the second swf loads but does not read the primary declared variables.
Now granted this was created in MX 2004 and I have moved to CS3, but I am still using AS 2.0 throughout all my swf’s.
So my question, finally is this how do I create a new mc container within the primary swf; load a second swf and allow the second swf when loaded to retrieve variables from the primary swf.
All swfs are within the same domain and loaded within mc containers within the primary swf.
I am willing to scrap my code and start again, but this nightmare is driving me insane.
Any assistance with this matter would be much appreciated.
Many thanks in advance, New AS.[/SIZE][/FONT]