Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / General Flash Topics / July 2008



Tip: Looking for answers? Try searching our database.

HTML Tags and XML document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rowan - 01 Jul 2008 20:53 GMT
Good day everyone,

I am creating a small Flash app that will get updated content from an XML
file.  The XML document looks like this:
<Event>
    <Data>
        <visible>1</visible>
                <Heading1>Heading Test</font></Heading1>
        <BodyText>Body test</BodyText>
        <ButtonText>Press Me</ButtonText>
        <URLText>http://www.rmp-consulting.com</URLText>
    </Data>

The above structure is repeated for every event.

In my Flash app, I am walking through the XML document with the following code:

while (element != null) {
                   
                    if (element.nodeName.toUpperCase() == "VISIBLE") {
                        isVisible.push(element.firstChild.nodeValue);
                    }
                   
                    if (element.nodeName.toUpperCase() == "HEADING1") {
                        heading.push(element.firstChild.nodeValue);
                    }
                    if (element.nodeName.toUpperCase() == "SUBHEADING") {
                        subheading.push(element.firstChild.nodeValue);
                    }
                    if (element.nodeName.toUpperCase() == "BODYTEXT") {
                        BodyText.push(element.firstChild.nodeValue);
                    }
                    if (element.nodeName.toUpperCase() == "BUTTONTEXT") {
                        ButtonText.push(element.firstChild.nodeValue);
                    }
                   
                    if (element.nodeName.toUpperCase() == "URLTEXT") {
                        URLText.push(element.firstChild.nodeValue);
                    }
                    element = element.nextSibling;
                   
                }
I then set dynamic text fields using the values in the array:

               
                this.news1.heading.text = heading[0];
                this.news1.BodyText.text = BodyText[0];
                this.news1.myButton.buttonText.text = ButtonText[0];
                this.news1.URLText.text = URLText[0];

Ideally, I want to be able to include some basic HTML formatting option in the
XML document.  I would like change the color and size.  But,as as soon as I
change my XML document to include these tags, the above code does not function
correctly.

Any suggestions?
Rowan - 01 Jul 2008 21:42 GMT
Might as well reply to my own post, and provide answer...

All I need to do was wrap my HTML tags with a <!CDATA[ ... ]] tag .. works like charm.
Rowan - 01 Jul 2008 21:42 GMT
Might as well reply to my own post, and provide answer...

All I need to do was wrap my HTML tags with a <!CDATA[ ... ]] tag .. works like charm.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.