ok, I’ve been fighting this since yesterday with no results and by now I’m going a bit desperate… if anyone out there knows of any info on this available through the web or have dealt with and cracked a similar problem, please, please, please, I could desperately use some advice.
I’ve searched for related issues, but none of them seems to cover this and I guess that’s partly because, for absurd as it might sound, there’s nothing wrong… let me make it clearer:
I’m programming a dinamic flash/xml website. up until now I’ve kept the info for the menus and the one for the gallery (the site has a gallery that displays both text and images) in separate xml files. but I’m trying to make all of it work out of a single xml file. I’ve managed to make the menus and the gallery all go get the info correctly to the xml (text and images), but then I came up with a problem that jeopardizes the whole show: a path inside the xml’s onLoad function refuses to work! the code that bears the function has to be placed into the same clip as the clips that contain the text fields to wich info will be passed or it won’t do a thing.
supose this is my actionscript code:
var contentSubMenu = new XML();
contentSubMenu.ignoreWhite = true;
contentSubMenu.load("example.xml");
//--------------------------------------------------
_root.contentSubMenu.onLoad = function() {
/* code */
//path to where the clips that bear the text fields to be filled are contained
**var buttonList = _root.listSubMenu_mc.listWindow_mc.buttonListSlide_mc;**
//example of **buttonList** usage:
//1) category loop
for (a=0; a<categories.length; a++) {
var category = categories[a];
//duplicates the clip that contains the category text field, assigns the proper category to that text field and adjusts the clips y position
**buttonList**.category_mc.duplicateMovieClip("category"+a+"_mc", getNextHighestDepth());
**buttonList**["category"+a+"_mc"].category_txt.text = category.toLowerCase();
...
...
/* loads of code */
}
unless _root.contentSubMenu.onLoad = function() and the code from there on is placed into _root.listSubMenu_mc.listWindow_mc.buttonListSlide_mc (right above category_mc),
no information is passed to that clip. If the path targets that clip one should expect it to, right? even if all this code is placed on _root, right? well, it doesn’t happen…
I tried tracing for info that comes from the xml, but nothing is displayed in the output window.
I’ve attached a zip file that contains a fla file, an xml file, a txt file with the full chunk of actionscript code and the fonts you’ll be needing should you decide to take a look (they’re only two).
The fla file has been built in the following manner:
_on the right side, the clips that hold the text fields to wich the contentSubMenu.onLoad function will pass info to are directly placed upon _root (so, following the code example from above, it would be like having var buttonList = _root;)
_on the left side, the clips that hold the text fields are down into buttonListSlide_mc and the contentSubMenu.onLoad function is there as well, only commented so it doesn’t display anything.
that way one situation is compared with the other more easily.
I have no idea why this is and if it should work it would make my code and website a lot more cleaner and effective, so if anyone would like to help I’d be deeply thankful.