Hello! I’m new (newb) and I really like your forums, learned much here
Now I have one question for my website. I made navigation like this:
var myMenyArray=[najave,onama,asesoar,kontakt,ponuda,klub,arhiva];
var loader:Loader;
for each (var btn in myMenyArray) {
btn.addEventListener(MouseEvent.CLICK, onBtnClick);
}
function onBtnClick(event:MouseEvent):void {
if (loader) {
removeChild(loader);
loader=null;
}
pages.gotoAndStop(event.target.name);
}
var Xpos:Number=350;
var Ypos:Number=200;
var swf:MovieClip;
function btnClick(event:MouseEvent):void {
if (loader) {
removeChild(loader);
loader=null;
}
pages.gotoAndStop(event.target.name);
loader = new Loader();
addChild(loader);
var newSWFRequest:URLRequest=new URLRequest(event.target.name + ".swf");
loader.load(newSWFRequest);
loader.x=Xpos;
loader.y=Ypos;
pages.gotoAndStop(2);
}
galerija.addEventListener(MouseEvent.CLICK, btnClick);
I would like for every button to load textual content from XML file so that it will be easier for site owner to edit it (except for the gallery that loads .swf already).
Please help me if you have a few minutes, I guess it’s not that hard but… first time doing something like this. :*(
XML will be like
<home> welcome to my site bla bla </home>
<contact> contact goes here </contact>
… and so on for all the content
So Contact button should load text in <contact> </contact> when its pressed and so on.
I was browsing through the forums but I didn’t find solution for my code so had to open new thread. Thanks anyone who answers.
Greetings