If anyone could help me out, please. I don't understand how to make links in a xml. And I've read through a lot of post and some of the links here. Most of them used an older flash player and thus didn't work with mine. So far it has been quite easy to work in xml and Flash but I'm completely lost in thi case. Here's my code for my xml file. I use flashplayer 7 and as 2.0:
Code:
stop();
container.stop();
var timeline = this;
System.useCodepage = true;
var loader2:XML = new XML();
loader2.load("files/Filer/Flash/overskrift.xml");
loader2.ignoreWhite = true;
loader2.onLoad = function() {
_global.rod2 = this.firstChild.childNodes;
var antalXML:Number = rod2.length-1;
setter(0);
};
setter = function (id) {
timeline.container_overskrift.overskrift.text = rod2[id].firstChild.firstChild.nodeValue;
timeline.container_overskrift.overskrift.autoSize = true;
timeline.container_overskrift.overskrift.multiline = true;
};
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random()*(max-min+1))+min;
return randomNum;
}
var loader:XML = new XML();
loader.load("files/Filer/Flash/tekst.xml");
loader.ignoreWhite = true;
loader.onLoad = function() {
_global.rod = this.firstChild.childNodes;
var antalXML:Number = rod.length-1;
for (i=0; i<1; i++) {
var randomNumber:Number = randRange(0, antalXML);
}
setter2(randomNumber);
};
setter2 = function (id) {
timeline.container.holder.tekst1.text = rod[id].firstChild.firstChild.nodeValue;
timeline.container.holder.tekst1.multiline = true;
timeline.container.holder.tekst2.text = rod[id].firstChild.nextSibling.firstChild;
timeline.container.holder.tekst2.multiline = true;
container.play();
_global.antal = id;
};
Regards
Michael