# Help on CData in XML and Flash

**URL:** <https://forum.kirupa.com/t/help-on-cdata-in-xml-and-flash/256315>\
**Category:** flash\
**Created:** [April 1, 2008, 10:49pm UTC](https://forum.kirupa.com/t/help-on-cdata-in-xml-and-flash/256315 "2008-04-01T22:49:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![youwh](https://avatars.discourse-cdn.com/v4/letter/y/82dd89/32.png) [@youwh](https://forum.kirupa.com/u/youwh)\
**Post date:** [April 1, 2008, 10:49pm UTC](https://forum.kirupa.com/t/help-on-cdata-in-xml-and-flash/256315/1 "2008-04-01T22:49:54Z")

</div>

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:

```auto
<link name="SIDE ORDERS" ref="<![CDATA["gotoAndStop(3);"]]>"/>

```

And here’s my Flash menu scripts:

```auto

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;
}

```
