I wanted to navigate my flash menu with my xml. How should I input the CData code in flash?
This is the code in my xml file:
<link name="SIDE ORDERS" ref="<![CDATA["gotoAndStop(3);"]]>"/>
And here’s my Flash menu scripts:
var yPos = 0;
var depthCount = 1;
var linksXML = new XML();
var xml_loaded = "menu.xml";
linksXML.ignoreWhite = true;
linksXML.load(xml_loaded);
linksXML.onLoad = checkLoading;
function checkLoading(success) {
if (success == true) {
var rootNode = linksXML.firstChild;
var total = rootNode.childNodes.length;
//Load the links Text
var tLink = rootNode.firstChild;
for (i=0; i<total; i++) {
createLink("tLink"+i,tLink);
var totalInner = tLink.childNodes.length;
var tnLink = tLink.firstChild;
for (j=0; j<totalInner; j++) {
createLink("tnLink"+j+""+i,tnLink);
tnLink = tnLink.nextSibling;
}
tLink = tLink.nextSibling;
}
gotoAndStop(2);
}
}
function createLink(newObj, aNode) {
duplicateMovieClip(this.baseLink, newObj, depthCount++);
var tcl = eval(newObj);
tcl.aLink = aNode.attributes.ref;
yPos += 15;
if (aNode.nodeName == "link") {
setName(tcl,aNode.attributes.name,1);
tcl._x = 195;
} else {
setName(tcl,aNode.attributes.name,0.95);
tcl._x =195;
}
tcl._y = yPos;
}
gotoAndStop(1);
function setName(obj, theName, Size) {
obj._height = obj._height*Size;
obj._width = obj._width*Size;
obj.TextLink.BoxName.text = theName;
obj.TextLinkShadow.BoxName.text = theName;
obj.embedFonts = true;
//obj.TextLinkShadow._alpha = 20;
}