# External preloader with xml menu please help!

**URL:** https://forum.kirupa.com/t/external-preloader-with-xml-menu-please-help/137450
**Category:** Uncategorized
**Created:** [February 14, 2005, 7:11pm UTC](https://forum.kirupa.com/t/external-preloader-with-xml-menu-please-help/137450 "2005-02-14T19:11:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![molk2](https://avatars.discourse-cdn.com/v4/letter/m/a4c791/32.png) [@molk2](https://forum.kirupa.com/u/molk2)
#### Post date: [February 14, 2005, 7:11pm UTC](https://forum.kirupa.com/t/external-preloader-with-xml-menu-please-help/137450/1 "2005-02-14T19:11:49Z")

</div>

hi i downloaded the bounce menu from [faithornstudios.com](http://faithornstudios.com) so its my iniciation with xml and external swf preloaders the menu loads the info from the xml and display the swf loaded into an empty MC so it loads external swf via xml, im trying to implement a preloader for that external swf but i dont know how please help i tried a lot of external preloaders tutorials and stil dont know how to implement them in the xml menu  
the menu:  
[www.faithornstudios.com](http://www.faithornstudios.com) its called bounce menu  
this is the AS  
first frame main timeline:  
gotoFunction = function(link) {  
loadMovie(link,containerMC)  
}  
stop()

it has a component the menu with the instance:  
menuComp

and the empty MC  
containerMC

actionscript of the component:  
/_By John Faithorn Sept.14 2003 9:46 am_/  
menus = new XML()  
menus.load(sourcefile)  
menus.ignoreWhite = true  
menus.onLoad = function(success) {  
menuData = menus.firstChild.childNodes

for(i=0;i\<menuData.length;i++){  
subNodes = menuData\*.childNodes  
if(menuData\*.nodeName == “button”){  
//Container clip holds submenu data  
attachMovie(“container”,“subContainer”+i,i-menuData.length)  
eval(“subContainer”+i).\_alpha = 0  
eval(“subContainer”+i).\_x = -300

//Main Button attaching and spacing  
attachMovie(“mainSuperButton”,“mainButton”+i,i)  
mainButtonRef = eval(“mainButton”+i)  
mainButtonRef.textVar = menuData\*.attributes.name  
mainButtonRef.index = i  
mainButtonRef.\_y =i\*mainSpace

//Main Button release action(rollover located in mainbutton mc)  
mainButtonRef.onRelease = function() {  
if(open == this.index){  
//second click error check. closes menu  
resetMenu()  
open = undefined  
}else{  
//first click  
open = this.index  
this.gotoAndStop(3)  
collapse(this)  
}  
//add any open state actions here… like alpha, etc…  
//containers are hidden off stage and moved on release  
}  
for(j=0;j\<=subNodes.length;j++){  
containerRef = eval(“subContainer”+i)  
if(subNodes[j].nodeName == “subitem”){  
containerRef.attachMovie(“subSuperButton”,“subButton”+j,j)  
containerRef[“subButton”+j].textVar = subNodes[j].attributes.name  
containerRef[“subButton”+j].page = subNodes[j].attributes.location  
containerRef[“subButton”+j].\_y = j\*subSpace

```
 containerRef["subButton"+j].onRelease = function() {
  //--------------------GOTO ACTION--------------\\
  _root.gotoFunction(this.page)
  this.gotoAndStop(3)
 }
}

```

}  
}  
}  
}  
function collapse (except) {  
num = except.index  
subRef = eval(“subContainer”+num)  
resetMenu()  
//The clips after the one clicked recieve new spots  
for(i=num+1;i\<=9;i++){  
eval(“mainButton”+i).JumpTo(subRef.\_height+i_mainSpace)  
}  
subRef.\_y = eval(“mainButton”+num).\_height+(num_mainSpace)+subYadjust  
subRef.\_x = subXfactor  
fade(subRef,“in”)  
}  
//resets everything to original places  
function resetMenu() {  
for(j=0;j\<=(9);j++){  
eval(“subContainer”+j).\_alpha = 0  
eval(“subContainer”+j).\_x = -1000000  
eval(“subContainer”+j).\_y = 0  
eval(“mainButton”+j).JumpTo(j\*mainSpace)  
}  
}  
function fade(fadeTarget,param) {  
if(param == “in”){  
fadeTarget.onEnterFrame = function(){  
this.\_alpha+=5  
}  
}  
}

i want to make a preloader for any swf that loads into ContainerMC so please help me!
