Forgive me, as coding is not my forte. I’m trying to generate buttons derived from an xml file, and attach the created buttons to a movie clip. Right now, nothing is appearing within the movieclip. Any help or suggestions are greatly appreciated.
_global.itemArray = new Array();
var button_spacing = 45;
var button_count = 0;
total_button_count = 0;
// ATTACH MOVIES
this.attachMovie("mButton","mButton",this.getNextHighestDepth(), {_x:950, _y:350});
this.attachMovie("mcMenu","mcMenu",this.getNextHighestDepth(), {_x:1024, _y:250});
this.attachMovie("arrow","arrow01",this.getNextHighestDepth(), {_x:480, _y:50});
//CLASSES/////////////////////////////////////////////////////////////////////////////////////////////
nButton = function() { };
nButton.prototype = new MovieClip();
nButton.prototype.init(my_pic, my_header, my_client, my_date1, my_desc, my_fulldesc)
{
this.curPic = my_pic;
this.curHeader = my_header;
this.curClient = my_client;
this.curDate = my_date1;
this.curDesc = my_desc;
this.curFullDesc = my_fulldesc; // CHANGED FOR FULL DESC
}
motionButton.prototype = new nButton();
stillButton.prototype = new nButton();
interactiveButton.prototype = new nButton();
Object.registerClass('wButton', nButton);
function CreateButtons (nHeader){
var button_mc = _root.mcMenu.attachMovie("wButton", "item" + total_button_count, total_button_count, {_x:0, _y:0});
button_mc._y = button_count * button_spacing;
// ASSIGN XML
button_mc.wName.text = nHeader;
_global.itemArray.push(button_mc);
item_count++;
total_item_count++;
};
var workArray = new Array();
var xmlWork:XML = new XML();
xmlWork.ignoreWhite = true;
xmlWork.onLoad = function (): Void {
items_list = xmlWork.firstChild.childNodes;
for ( i=0; i < items_list.length; i++ ) {
CreateThumbs(items_list*.attributes.Header); // CHANGED FOR FULL DESC
}
};
xmlWork.load("work.xml");