473,397 Members | 1,985 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,397 software developers and data experts.

Problem getting data from xml...

Why message var is always empty?

Expand|Select|Wrap|Line Numbers
  1. var x:XML = new XML();
  2. x.ignoreWhite = true;
  3. var total:Number;
  4. var clave:Array = new Array();
  5. var friends:Array = new Array();
  6. var birthday:Array = new Array();
  7. var favourite:Array = new Array();
  8. var telephone:Array = new Array();
  9. var address:Array = new Array();
  10. var message:String;
  11.  
  12. x.onLoad = function(success) {
  13.     if (success) {
  14.     var friendsdata:Array = this.firstChild.childNodes;
  15.     total = friendsdata.length;
  16.     for(i=0;i<friendsdata.length;i++) {
  17.         clave.push(friendsdata[i].attributes.clave);
  18.         friends.push(friendsdata[i].attributes.friends);
  19.         birthday.push(friendsdata[i].attributes.birthday);
  20.         favourite.push(friendsdata[i].attributes.favourite);
  21.         telephone.push(friendsdata[i].attributes.telephone);
  22.         address.push(friendsdata[i].attributes.address);
  23.     }
  24. for(m = 0 ; m < total ; m++){
  25. message += _global.count[m]+" "+friends[m]+". ";
  26.         }
  27.     }
  28. }
  29. x.load("power.xml");
  30. trace(message);
THE XML:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <speech>
  3. <friendsdata clave="10" birthday="10-09-1987" favourite="potato" telephone="Lorem ipsum dolor sit amet consectetuer adipiscing elit. Donec blandit sapien a mi. Nulla euismod ornare elit. Donec accumsan orci id mauris. Donec suscipit ullamcorper sapien. Quisque at leo ac erat pharetra ultrices. Aliquam euismod pede. Donec pretium. Vestibulum feugiat ultricies nunc. Quisque id orci. Ut consequat. Ut eu nibh. Suspendisse sit amet turpis." />
  4. <friendsdata clave="11" birthday="12-28-1990" favourite="bogus" telephone="Nulla placerat, dolor non tempus fringilla, justo lacus vehicula urna, non scelerisque nibh enim quis est. Maecenas vel enim. Morbi mattis. " />
  5. <friendsdata clave="12" birthday="01-04-1975" favourite="aleatory data" telephone="Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nam gravida placerat metus. Vestibulum imperdiet, ante vitae accumsan mollis, sapien orci mollis leo, sit amet nonummy pede risus sit amet ante. Integer turpis eros, convallis tincidunt, tempor vitae, consectetuer eget, urna. Nunc sed elit eget lacus venenatis sagittis. Vivamus scelerisque mollis nulla. Nam non purus id dui ullamcorper iaculis." />
  6. </speech>
  7.  
Feb 18 '08 #1
1 1630
By the way, I have several questions about XML loaded vars that may a gentle soul in this forum answer for my intelectual pleasure and sanity.

Considering a big XML:

- Should I load all the vars at the beggining of the movie to have them at my dispossal for the whole movie?
- Does this works or will they dissappear next frame?
- Do loaded vars become timeline vars?
- Is it better to load the XML in pieces, just the needed values for every frame?
- If so, do I need to repeat the whole loading operation from scratch?
- Is the lag during loading a real problem? Is there a handy function to prevent the movie to advance till vars are fully loaded?
Feb 18 '08 #2

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

Similar topics

11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
5
by: Brian Henry | last post by:
I have a page which reads an article from the database it has 1 text box, 2 dropdown lists, and a longreat HTML text box. I load the information from the database when the page is set to edit mode...
15
by: Peter Afonin | last post by:
Hello, I'm struggling with the string conversion to MD5 which I've never user before. I have a string that I need to encode which looks approximately like this: ...
8
by: I am Sam | last post by:
Hi everyone, This problem is making me old. I don't want to get any older. I have a multi-nested repeater control as follows: <asp:Repeater ID="clubRep1" Runat="server">...
5
by: H J van Rooyen | last post by:
Hi, I am struggling to get the pack method to do what I intend. I am trying to display user input in a seperate window, along with a little description of the field, something like this: ...
1
by: siddu | last post by:
HI All , I am getting Problem with connection string.I know the syntax and Everything.I am getting problem with Data Source name.I Checked in Service manager in that server name is like this...
6
by: Suresh | last post by:
Hi All, I am fetching a dataset from the database under some condition. After this I create a data table. Traverse in the original dataset & add each row to created data table as it is through...
4
by: CindyH | last post by:
Hi: I have the following code: Dim url As String = "http://xx01xx01:800/some.ashx" Dim myrequest As System.Net.WebRequest = Nothing Dim myresponse As System.Net.WebResponse = Nothing...
9
by: =?Utf-8?B?dHBhcmtzNjk=?= | last post by:
OK I have some Chinese text in sql server column that looks like this: 12大专题调研破解广东科学发展难题 This is unicode? Anyway, I put this data into a text area like this:...
0
ayanmitra2007mindtree
by: ayanmitra2007mindtree | last post by:
Dear Community Members, Ours is a Windows Application where we are using Remoting to connect our application server (running as a Windows Service). We are using SQL Server 2000 SP3 as database. At...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...

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.