| Welcome to Brackenwood. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| Retreive Data From Xml Feed?; how would i do that? | |
|---|---|
| Tweet Topic Started: Apr 19 2005, 08:42 PM (115 Views) | |
| demented_yam | Apr 19 2005, 08:42 PM Post #1 |
![]()
Brackenwood Heavyweight
|
there is an online political simulation game that i am a member of, and i am interested in making the world map for it in flash. however, the map cannot be static, it needs to retrieve data from an XML document (to see who is in control of which region, ect.) to put it simply: how do i do that? |
![]() |
|
| Markham Carroll | Apr 20 2005, 11:45 AM Post #2 |
|
Custom member title
|
|
![]() |
|
| demented_yam | Apr 20 2005, 01:50 PM Post #3 |
![]()
Brackenwood Heavyweight
|
the .xml file already exists, i just need to pull the data off of it. but yea, i'll check out the help menus (never even occurred to me that i might find something useful in there )
|
![]() |
|
| Markham Carroll | Apr 21 2005, 02:45 AM Post #4 |
|
Custom member title
|
You misunderstand - to get XML data, you need to create an XML object in Flash using actionscript and then load an XML file into it. |
![]() |
|
| demented_yam | Apr 21 2005, 05:16 AM Post #5 |
![]()
Brackenwood Heavyweight
|
... oh. well then. |
![]() |
|
| mikepol | Apr 21 2005, 09:42 AM Post #6 |
![]()
Brackenwood Newbie
|
and to make parsing easy, i'd use http://www.xfactorstudio.com/ fer sure! |
![]() |
|
| Squidclops | Apr 24 2005, 09:24 PM Post #7 |
|
Guy with a hat.
|
To access the data in your xml file vie flash you need 2 things: 1. an XML object 2. you need to know the structure of the xml document The XML object in flash lets you access xml nodes and their attributes but you need to know the structure of the data in your xml document otherwise you wont know what data to access and how. You can access the xml data through querying various properties of the xml object, for example childNodes, and firstChild. The easiest way to think of an xml document is as a multi - dimensional array. You will find that when you want to read a property of your xml object you will most likely be looking at an array or information held in an array. As an example you will see that the property childNodes will return an array of xml nodes from your xml object. Likewise the property firstChild returns the first array item from a list of xml nodes. You can also use the array index square brackets to access xml data. For example indices in an array of childNodes can be accessed thus: childNodes[x]. This comes in very handy. And because the childNodes property is an array you can apply the length property to it to see how many items there are in the array. And so on and so forth. |
![]() |
|
| BonzaiRob | May 1 2005, 09:52 PM Post #8 |
|
The Demon Plasterer
|
Is it possible to send data to XML? I'm trying to make a 2d interaction envionment... I'll have sprites for the people in the area (8 max) which get instructions such as the direction they are facing and position from the XML; of course, to move your character, it would send updated info to the XML for the others in the area to see you move. This could also be used for chats, you'd just have a node for the chatroom and anyone could add to it... |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Actionscript · Next Topic » |







)

12:27 AM Jul 12