xml grab problem

Talk / ask questions about Macromedia Flash and related software.

Moderators: HeRetiK, The inner Core

User avatar
S. [Burned] Y.
divine
divine
Posts: 3748
Joined: Thu Aug 18, 2005 7:09 am
Location: 4.252.99.182
Contact:

xml grab problem

Postby S. [Burned] Y. » Wed Nov 08, 2006 10:33 pm

Anyone see a problem? I sure don't, but there is. But whenever I export the flash, the text appers then vanishs..

Format For Xml

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE contentnews>
<contentnews>
<content>
<headline_text>Text being seen</headline_text>
</content>
</contentnews>


Format In Flash To Grab Xml

Code: Select all

urlXML = new XML();
urlXML.onLoad = convertXML;


content_feed_display = "Loading data...";
urlXML.load("C:/Documents and Settings/Burned.BURNED-LEET/Desktop/xml.xml");


function convertXML() {
   if(this.loaded) {
      content_feed_display = "Data loaded.";
   }
   mainTag = new XML;
   elementTag = new XML;
   contentList = new Array;
   elementList = new Array;
   mainTag = this.firstChild.nextSibling;
   if(mainTag.nodeName.toLowerCase() == "contentnews") {
      contentList = mainTag.childNodes;
      content_feed_display = "";
      for(i=0;i<=contentList.length;i++){
         headline_text = "";
         if(contentList[i].nodeName.toLowerCase() == "content") {
            elementList = contentList[i].childNodes;
            for(j=0;j<=elementList.length;j++) {
               elementTag = elementList[j];
               elementType = elementTag.nodeName.toLowerCase();
               (elementType == "headline_text"){
                     headline_text = elementTag.firstChild.nodeValue;
               }         
            }
         }
      }
   
   
   }
For all we know humans are just weapons created by the world.
Yonaka Sanryu - This thread makes the EMOs slit their wrists.
Image

User avatar
HeRetiK
Site Admin
Site Admin
Posts: 7931
Joined: Mon Mar 31, 2003 7:50 pm
Location: yurop
Contact:

Postby HeRetiK » Thu Nov 09, 2006 8:31 am

maybe your for loop is running one time to often, therefore overwriting the content values?

try replacing the <= with a <

for(i=0;i<contentList.length;i++){
headline_text = "";
if(contentList[i].nodeName.toLowerCase() == "content") {
elementList = contentList[i].childNodes;
for(j=0;j<=elementList.length;j++) {
elementTag = elementList[j];
elementType = elementTag.nodeName.toLowerCase();
(elementType == "headline_text"){
headline_text = elementTag.firstChild.nodeValue;
}
}
}
}

User avatar
S. [Burned] Y.
divine
divine
Posts: 3748
Joined: Thu Aug 18, 2005 7:09 am
Location: 4.252.99.182
Contact:

Postby S. [Burned] Y. » Thu Nov 09, 2006 8:15 pm

Yay, thanks, it's working. Now I just have to work on making it so the text being shown, isn't clickable. :roll:
For all we know humans are just weapons created by the world.

Yonaka Sanryu - This thread makes the EMOs slit their wrists.

Image

User avatar
HeRetiK
Site Admin
Site Admin
Posts: 7931
Joined: Mon Mar 31, 2003 7:50 pm
Location: yurop
Contact:

Postby HeRetiK » Thu Nov 09, 2006 10:14 pm

Wow, I really spotted the mistake. yay.

Burned wrote:Yay, thanks, it's working. Now I just have to work on making it so the text being shown, isn't clickable. :roll:



;)

Image

User avatar
S. [Burned] Y.
divine
divine
Posts: 3748
Joined: Thu Aug 18, 2005 7:09 am
Location: 4.252.99.182
Contact:

Postby S. [Burned] Y. » Thu Nov 09, 2006 11:51 pm

It's dynamic, and the selectable isn't on. When I export it, you can click on it, even though it doesn't have any link properties.
For all we know humans are just weapons created by the world.

Yonaka Sanryu - This thread makes the EMOs slit their wrists.

Image

User avatar
HeRetiK
Site Admin
Site Admin
Posts: 7931
Joined: Mon Mar 31, 2003 7:50 pm
Location: yurop
Contact:

Postby HeRetiK » Thu Nov 09, 2006 11:53 pm

strange. I guess you don't have any forgotten hidden buttons behind it, or activated to render it as html and added a href link into the string?




...




sorry, I'm out of good advices right now.

User avatar
S. [Burned] Y.
divine
divine
Posts: 3748
Joined: Thu Aug 18, 2005 7:09 am
Location: 4.252.99.182
Contact:

Postby S. [Burned] Y. » Fri Nov 10, 2006 1:05 am

Nope..it's okay though, you solved one problem :D
For all we know humans are just weapons created by the world.

Yonaka Sanryu - This thread makes the EMOs slit their wrists.

Image


Return to “Flash”

Who is online

Users browsing this forum: No registered users and 1 guest