Hey Guys
I am almost finished with a project, except that I am stuck in a annoying problem.
I have an xml that has “project names” that are loaded into a menu, and that also has another xml filenames as an attribute.
I have successfully loaded the project names into a menu, (each as a separate movie that work as buttons) but now I can’t get the files to load correctly.
I know this isn’t as hard as I am making it to be, but my brain is fried! could anyone help point me in the right direction?
here’s my xml
<menu>
<project title="LIFE" action="load_xml" file="xmlfiles/life.xml"/><!--childnode, attribute-->
<project title="ESQUIRE" action="load_xml" file="xmlfiles/esquire.xml"/>
<project title="PREMIERE" action="load_xml" file="xmlfiles/premiere.xml"/>
<project title="US" action="load_xml" file="xmlfiles/us.xml"/>
<project title="VIBE" action="load_xml" file="xmlfiles/vibe.xml"/>
<project title="SONY STYLE" action="load_xml" file="xmlfiles/sonystyle.xml"/>
<project title="GALLUP" action="load_xml" file="xmlfiles/gallup.xml"/>
<project title="ADVISOR" action="load_xml" file="xmlfiles/advisor.xml"/>
</menu>
actionscript to create submenus and call slideshows
//creating submenus
var myHeight=15
var startPos=0
function subBtns(){
var p=-1
var end2=projects.length
while(++p<end2){
submenu.mcButtons.duplicateMovieClip("mcButtons"+p,p)
var curr_item=submenu["mcButtons"+p]
startPos=120
curr_item._x=this._x
curr_item._y=52+(myHeight*p)
curr_item.t1.text=projects[p]
//buttons
//rollover functions
curr_item.onRollOver=function(){
this.alphaTo(60,.25,"easeOutSine")
this.trackAsMenu=true
}
curr_item.onRollOut=function(){
this.alphaTo(100,.25,"easeOutSine")
MainMenu();
}
//onRelease loads slideshow and removes submenu movie
curr_item.onPress=function(){
xmlData.load(life[p])
MainMenu();
CloseSubmenus();
}
}
}
/////////////slideshow
function loadLife(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
width = [];
height = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;
width* = xmlNode.childNodes*.childNodes[1].firstChild.nodeValue;
height* = xmlNode.childNodes*.childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadLife;