Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 11th, 2012, 10:32 AM
kumba kumba is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 32 kumba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 30 m 52 sec
Reputation Power: 5
ActionScript 2 - AS2 - Arrays to textbox

I need to pull data from an xml array, then have it alternate listing the data in the same text box.

Here is the how I'm loading the XML:
Code:
loadXML = function (loaded) {
        if (loaded) {
               xmlNode = this.firstChild;                            
               contentBorder = Number(xmlNode.childNodes[0].attributes.Border);
               contentWidth = Number(xmlNode.childNodes[0].attributes.Width);
               contentHeight = Number(xmlNode.childNodes[0].attributes.Height);
               txt_mc.txthead.htmlText = xmlNode.childNodes[0].firstChild.nodeValue;
               txt_mc.txt.htmlText = datecom + xmlNode.childNodes[1].firstChild.nodeValue;                                  
               headerName.text = xmlNode.attributes.Name;
 
}
        } else {
               trace("Error loading XML");
        }
};
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (_root.toLoad == undefined) {
    _root.toLoad = "dailylog.xml";    
}
xmlData.load(_root.toLoad);


Here is my conceptual approach (but to no success):

Code:
// LOAD XML
loadXML = function (loaded) {
        if (loaded) {
               xmlNode = this.firstChild;                            
               contentBorder = Number(xmlNode.childNodes[0].attributes.Border);
               contentWidth = Number(xmlNode.childNodes[0].attributes.Width);
               contentHeight = Number(xmlNode.childNodes[0].attributes.Height);
               txt_mc.txthead.htmlText = xmlNode.childNodes[0].firstChild.nodeValue;
       for (i=0; i<total; i++) {
    headline[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
    copy_full[i] = xmlNode.childNodes[i].childNodes[5].firstChild.nodeValue;
}
txt_mc.txt.htmlText = datecom + headline[i]+"\n"+copy_full[i];
}
}
        } else {
               trace("Error loading XML");
        }
};
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
if (_root.toLoad == undefined) {
    _root.toLoad = "dailylog.xml";    
}
xmlData.load(_root.toLoad);


Here is the result I need displayed in the texbox:
********************************************
FLASHBACK - OBAMA ON AIG BONUSES --- (headline[0])

Obama talks about the executive bonues at AIG. He talks about how they are in financial distress due to greed.
(021010OLDOBAMA01) Q… greed Time ¬ 16 seconds --- (copy_full[0])

He talks about how it’s hard to understand how AIG awarded these bonues and how can they justify this to the taxypayers.
(021010OLDOBAMA02) Q… afloat Time ¬ 18 seconds --- (copy_full[0])

Obama then says he is asking Sect. Geitherner to use every single possible way to block the bonuses.
(021010OLDOBAMA03) Q… applause Time ¬ 18 seconds --- (copy_full[0])

BIDEN GAFFE - IRISH PM'S MOTHER --- (headline[1])

Biden, talking about the mother of the Irish PM, says God rest her soul- oh wait, she’s still alive- God bless her soul! I gotta get this straight!
(031810BIDENGAFFE) Q…straight Time – 21 seconds --- (copy_full[1])

ETC. --- (headline[2])

ETC. --- (copy_full[2])

ETC. --- (headline[3])

ETC. --- (copy_full[3])
*******************************************

Here is a condensed version of the xml being loaded:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<content>
<article>
<headline>FLASHBACK - OBAMA ON AIG BONUSES</headline>
<date>2010 November 14</date>
<copy_intro><![CDATA[<p>Obama flashback in March of 2009 on AIG and financial responsibility</p>]]></copy_intro>
<image_thumb>DailyAudio/Pics/ ObamaAIGSmall.jpg</image_thumb>
<image_large>DailyAudio/Pics/ObamaAIGBig.jpg</image_large>
<copy_full><![CDATA[<p>Obama talks about the executive bonues at AIG. He talks about how they are in financial distress due to greed.
<font color="#666666">(021010OLDOBAMA01) Q… greed Time ¬ 16 seconds</font><br>He talks about how it’s hard to understand how AIG awarded these bonues and how can they justify this to the taxypayers.
<font color="#666666">(021010OLDOBAMA02) Q… afloat Time ¬ 18 seconds</font><br>Obama then says he is asking Sect. Geitherner to use every single possible way to block the bonuses.
<font color="#666666">(021010OLDOBAMA03) Q… applause Time ¬ 18 seconds</font><br>He then makes sure to let everyone know that Sect Geithner is on the case and is going to get things solved.
<font color="#666666">(021010OLDOBAMA04) Q… last year Time ¬ 16 seconds</font><br>Obama then says that this is not just a matter of dollars and cents. It’s about fundamental values. He then talks about Americans meeting their responsibilities without bailouts or bonuses.
<font color="#666666">(021010OLDOBAMA05) Q… bonuses Time ¬ 20 seconds</font><br>Obama then talks about people forgoing pay so they can just keep their creditline open and keep their mortgages.
<font color="#666666">(021010OLDOBAMA06) Q… a float Time ¬ 20 seconds</font><br>He says that the main thing that these people on “main street” want is for Wall Street to be held to the same standards.
<font color="#666666">(021010OLDOBAMA07) Q… again Time ¬ 20 seconds</font><br>Obama talks about how there should be some form of resolution mechanism that protects Americans and the financial system just in case this happens again.
<font color="#666666">(021010OLDOBAMA08) Q… as this Time ¬ 12 seconds</font><br>Obama then makes a joke about how he is choked up with angery.
<font color="#666666">(021010OLDOBAMA09) Q… here Time ¬ 10 seconds</font><br>He says that they, the government, have some form of resolution to deal with banks but with companies like AIG, the government doesn’t.
<font color="#666666">(021010OLDOBAMA10) Q… here Time ¬ 23 seconds</font><br></p>]]></copy_full>
</article>

<article>
<headline>BIDEN GAFFE - IRISH PM'S MOTHER</headline>
<date>2010 November 14</date>
<copy_intro><![CDATA[<p>Biden stating the mother of the Irish PM is dead, when she’s very much alive.</p>]]></copy_intro>
<image_thumb>DailyAudio/Pics/BidenSmall.jpg</image_thumb>
<image_large>DailyAudio/Pics/BidenBig.jpg</image_large>
<copy_full>
<![CDATA[<p>Biden, talking about the mother of the Irish PM, says God rest her soul- oh wait, she’s still alive- God bless her soul! I gotta get this straight!
<font color="#666666">(031810BIDENGAFFE) Q…straight Time – 21 seconds</font><br></p>]]>
</copy_full>
</article>

<article>
<headline>CLINTON SAYS ISRAEL INSULTED USA</headline>
<date>2010 November 14</date>
<copy_intro><![CDATA[<p>Secretary of State Hillary Clinton says Israel insulted the United States with Jerusalem settlement announcement</p>]]></copy_intro>
<image_thumb>DailyAudio/Pics/HClintonSmall.jpg</image_thumb>
<image_large>DailyAudio/Pics/HClintonBig.jpg</image_large>
<copy_full><![CDATA[<p>Clinton says our ……etc, etc, etc.</p>]]>
</copy_full>
</article>
</content>

Any and all help on this is greatly appreciated. Thanks for taking a moment to help out a newbie!!!

Kumba

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > ActionScript 2 - AS2 - Arrays to textbox

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap