here’s my problem:
i have one main swf that loads external swf files for each section of a website. one section contains show dates and information that is pulled from an xml file and dynamically drawn out using createEmptyMovieClip() and createTextField(). it works great. however, when i click on a different section of the website, the shows swf will perform its “out” transition and switch to the section selected, but all of the dynamic text from the shows xml file remains on the screen. is this something to do with depths? how can i fix this?
just for reference, here is my actionscript for the shows section that draws out all of the data dynamically:
var shows:XML = new XML ();
shows.ignoreWhite = true;
shows.onLoad = function (success) {
if (success) {
// get show
var root:Object = shows.firstChild.childNodes;
var lngth:Number = root.length;
// get show's info
var sub_root:Object = shows.firstChild.firstChild.childNodes;
var sub_lngth:Number = sub_root.length;
// loop variables
var mc:MovieClip;
var i:Number = 0;
var j:Number = 0;
// movieclip information
var startx = 150;
var starty = 100;
var vspace = 2;
var hspace = 2;
var wdth = 160;
var hgth = 50;
// create grid
for (i = 0; i < lngth; i++) {
for (j = 0; j < sub_lngth; j++) {
// create each movieclip
mc = _root.createEmptyMovieClip ("row" + (i+1) + "_item" + (j+1), _root.getNextHighestDepth ());
mc._x = startx + (wdth + vspace) * j;
mc._y = starty + (hgth + hspace) * i;
// create each text field
mc.createTextField("tf_txt", 0, 0, 0, wdth, hgth);
mc.tf_txt.text = shows.firstChild.childNodes*.childNodes[j].firstChild.nodeValue;
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = 0x000000;
my_fmt.font = "Arial";
my_fmt.size = 15;
mc.tf_txt.setTextFormat(my_fmt);
mc.tf_txt.selectable = false;
mc.tf_txt.multiline = true;
mc.tf_txt.wordWrap = true;
mc.tf_txt.autoSize = true;
mc.tf_txt.embedFonts = true;
mc.tf_txt.html = true;
//trace('row: ' + i + ', column: ' + j + ', text: ' + shows.firstChild.childNodes*.firstChild.childNodes[j].nodeValue);
}
}
// delete xml object
delete shows;
}
};
shows.load ("schedule.xml");