Post edited 5:57 pm – August 24, 2010 by Xiaz
I really love the vertical menu tutorial, I will be a great asset to my project if I can only find a way to reload the menu. I have been trying for about a week now, with no success. please can someone help me reload this great menu
this is the error I'm getting
TypeError: Error #2007: Parameter url must be non-null.at flash.net:URLStream/load()at flash.net::URLLoader/load()at Vert_fla::MainTimeline/btn_click()
here is what I tried
var a = “menu.xml”
var b = “menu2.xml”
btn1.addEventListener(MouseEvent.CLICK,btn_click);
btn2.addEventListener(MouseEvent.CLICK,btn_click);
/////my function to unload and reload the menu/////
function btn_click(event:MouseEvent){
var selected_list:String
if(event.target == btn1){
menuHolder.removeAll();
selected_list = a;
}else if(event.target == btn2){
menuHolder.removeAll();
selected_list = b;
}
loader.load(new URLRequest(selected_list));
}
/////loads my xml /////
var xml:XML;
var loader.load(new URLLoader();
loader.load(new URLRequest(“menu1.xml”));
loader.addEventListener(Event.COMPLETE,xmlLoaded);
function xmlLoaded(e:Event):void{
if ((e.target as URLLoader) !=null){
xml = new XML(loader.data);
createMenu();
}
}
/////holder that contains items/////
var menuHolder:MovieClip = new MovieClip();