473,320 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

XML gives undefined result in ActionScript 2.0

This is one of XML file which I have:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <root>
  3.     <document>
  4.         <title>What is lorem ipsum ?</title>
  5.         <description>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</description>
  6.     </document>
  7. </root>


The ActionScript code is this

Expand|Select|Wrap|Line Numbers
  1. function loadXML(loaded) { if (loaded) { xmlNode = this.firstChild; _root.simple_title = []; _root.simple_description = []; total = xmlNode.childNodes.length; for (i = 0; i < total; i++) { xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue; } } else { trace("XML is not loaded!"); } }
  2.  
  3. xmlData = new XML(); xmlData.ignoreWhite = true; xmlData.onLoad = loadXML; xmlData.load("simple.xml");
Now everything it's okay in the root timeline actually it's work for example I've one movieclip called content and inside them I have 2 textfields the title and description text now I try to call in root and that's work

Expand|Select|Wrap|Line Numbers
  1. content.titleID.text = simple_title[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue; content.descriptionID.text = simple_description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
Now I try to call from content movieclip the childNodes from root for example:

Expand|Select|Wrap|Line Numbers
  1. titleID.text = _root.simple_title[0] descriptionID.text = _root.simple_description[0]
Now the XML gives undefined result, yes that's the issue which I can't do!
Sep 14 '10 #1
0 1211

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Morten | last post by:
Hi. Trying to generate some images with imagemagick. The following works on the command line: /usr/local/bin/convert xc:yellow -resize 100x15! -gravity "West" -draw "text 0,0 'Path Two'"...
2
by: swhite76 | last post by:
I have a section of code that adds some double values and gives an incorrect result. This occurs with data that isn't really waht I would call high precision. An example is the following code...
0
by: pervinder | last post by:
Hi, I have an application which uses math/matrix solving lib like blas, lapack. When i build the binary using forte7 , it passes. But when i change the compiler to forte8, i get 2 undefined symbol...
4
by: marcus | last post by:
I have this class A that contains a method A_method that opens a file and does fgets. I also have a template class B that contains a method B_method that takes a class A object as template type....
2
by: Rashida | last post by:
Hi all! I have written a function to fetch lebels from xml file for cross-language interoperability. Please refer function code below. I am invoking itfrom my asp page saying...
0
by: Mark Sapiro | last post by:
email.Utils.parseaddr('Real Name ((comment)) <address@example.com>') returns ('comment <address@example.com>', 'Real') Granted the string above is invalid as RFC 2822 does not allow...
2
by: Paul Furman | last post by:
Why would if (isset($variable)){do stuff;} give an 'undefined veriable' error? That's the reason I put it in there, to avoid that!
2
by: gngui | last post by:
i have a query that subtracts the date of birth (dob) from the date, i.e. age_d: Date()- This is OK as it gives me the difference in days e.g. 700 days. i would like the result to show me the age...
3
by: Deano | last post by:
I have a nice report that uses sql to report employee absences. I grab the employee and related absence data using the employee id field which is unique. I use the employee id as a header on...
2
by: kailashchandra | last post by:
<html> <head> <title>PHP Test</title> </head> <body> <?php echo $_SERVER; ?> </body> </html>
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.