473,788 Members | 2,751 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem getting data from xml...

2 New Member
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 1649
qrosity
2 New Member
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
6639
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 transfer data across.On the serve I am using Socket 2 API (recv function to read bytes)and not using ..NET. I use FileStream to open the file on the pocket pc, then associate a BinaryReader object with the stream and call ReadBytes to read all the...
5
1431
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 from a query string action=edit, now when i click on the update button it does the update event, the problem is, it still has the old unedited data in memory... and places the old stuff back into the database (saw this when debugging) the SQL is...
15
2439
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: "pva:0.05:101214:pa7735tH:inv_desc=205308:shp_Email=petera_gudzon.net:lang =ru:shp_PaymentNo=20040825205308:shp_UserID=pva:shp_Price=2.95:shp_HostPlan= BU:shp_Term=2"
8
2917
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"> <HeaderTemplate><table> </HeaderTemplate> <ItemTemplate>
5
3543
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: Current entry Company : entered co. name First entry : entered stuff The second entry: more entered stuff
1
929
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 B4B-2F-323-CK26. But when i try to open Enterprise manager then it is showing (local)windowsNT. My connection String like this: ------------------------------
6
3801
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 LoadDataRow method. After adding the row I just update 4-5 columns out of 20 columns in the row. After entire looping I fire the AcceptChanges method on data table. After this I am trying to update this data back to database in two ways - 1) Merge...
4
2237
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 'Prepare web request myrequest = System.Net.WebRequest.Create(url) 'use POST
9
14145
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: articleArea.InnerHtml = article.Text . . .. and it works fine (shows chinese characters). But when I put this data into a asp:textbox control, it just shows up as is... (12大&# etc...) Can anyone tell me how to get the characters to appear...
0
1650
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 a certain instance while performing a huge transaction (when our application updates some 9000+ records) we are getting the following error: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) ...
0
9656
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10173
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9967
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
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, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7517
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.