# XML in Flash is for rocket scientists

**URL:** <https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736>\
**Category:** Uncategorized\
**Created:** [January 21, 2003, 5:53pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736 "2003-01-21T17:53:59Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![DJ\_Lex](https://avatars.discourse-cdn.com/v4/letter/d/f17d59/32.png) [@DJ\_Lex](https://forum.kirupa.com/u/DJ_Lex)\
**Post date:** [January 21, 2003, 5:53pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/1 "2003-01-21T17:53:59Z")

</div>

… and I’m just a designer.

I think I read every tutorial, downloaded every FLA that links off this site… and then some.

I grasp the concepts, just can’t make it work. The tutorial files are way too complicated for what I’m trying to do.

I’m trying to write a Flash app that will get the currently playing track for my webcast. This info is available in the following XML document:

[http://www.live365.com/pls/front?handler=playlist&handle=lextasy&cmd=view&viewType=xml](http://www.live365.com/pls/front?handler=playlist&handle=lextasy&cmd=view&viewType=xml)

It shows the current song and last few songs played. It also gives a time when it will automatically refresh.

Any help would be appreciated. :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 6:02pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/2 "2003-01-21T18:02:58Z")

</div>

Well XML into Flash is advanced period. I don’t think there is a “simple” way. If you know how to do it, it seems simple, but it takes a lot to learn how to do XML into Flash.

I have tried to learn because that is one thing I really want to know how to do with Flash, but it is too advanced for me right now.

[SIZE=1]Anyone know any good tutes…lol ;)[/SIZE]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 6:10pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/3 "2003-01-21T18:10:59Z")

</div>

I’ve looked at all the tutorials and just ended up getting frustrated. The best info I did find was here: [http://actionscript-toolbox.com/xmlobject.php](http://actionscript-toolbox.com/xmlobject.php)…

"Reading in xml data requires these steps:

- define the function that will be executed when the data has loaded (function myLoad in the example)

- create a new XML object (thisXML)

- set ignoreWhite to true (so Flash won’t treat carriage returns and other whitespace in the xml file as separate nodes – only works in r41+ revisions of Flash 5 if xmlnitro.as not used in conjunction)

- tell Flash which function will be used when the data has loaded

- load the data!"

At least that helped me grasp what I’m doing. Now, just need to learn how to write each part.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 6:13pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/4 "2003-01-21T18:13:11Z")

</div>

Yeah, I knew that stuff. I don’t know how to write it in AS.

I get all confused with the objects and the nodes and childnodes and parent nodes and such… it makes my head spin.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 6:57pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/5 "2003-01-21T18:57:41Z")

</div>

beta’s fuzzy lil head spinning … that’s a great image ![](http://www.roughedout.com/betaspin.gif)

i’m gonna keep my eye on this thread … hopefully someone will know the answer b/c i’d like to know as well. i’m learning xml at the moment (i just started reading) and i would like to know how to integrate it into flash :trout:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 6:58pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/6 "2003-01-21T18:58:45Z")

</div>

Hey, you put my head in your post 😛

Now my head is spinning even more :o

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 7:03pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/7 "2003-01-21T19:03:23Z")

</div>

I too try to avoid the subject of XML in Flash. For a simple application which needed XML I used the tutorial from the book “Advanced Action Scripting - Learning from the source”.  
\<Br\>\<BR\>  
\<A href=“[http://www.amazon.com/exec/obidos/tg/detail/-/0201770229/qid=1043175465/sr=8-1/ref=sr\_8\_1/102-3338030-8777742?v=glance&s=books&n=507846](http://www.amazon.com/exec/obidos/tg/detail/-/0201770229/qid=1043175465/sr=8-1/ref=sr_8_1/102-3338030-8777742?v=glance&s=books&n=507846)”\>Book Link Here\</a\>  
\<br\>\<br\>  
It’s the best description of the subject I have found so far.  
\<BR\>\<Br\>  
Hope this helps.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 7:11pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/8 "2003-01-21T19:11:31Z")

</div>

thought i’d make that lil graphic for ya =)

for all the times you’ve helped me out

![](http://www.roughedout.com/betaspin.gif) ![](http://www.roughedout.com/betaspin.gif) ![](http://www.roughedout.com/betaspin.gif) ![](http://www.roughedout.com/betaspin.gif) ![](http://www.roughedout.com/betaspin.gif) ![](http://www.roughedout.com/betaspin.gif) ![](http://www.roughedout.com/betaspin.gif)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 7:55pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/9 "2003-01-21T19:55:07Z")

</div>

So, I have the following info I’m trying to use:

- Playlist  
Refresh
  - PlaylistEntry  
Title  
Artist  
Album  
FileName  
Seconds

There are always 10 **PlaylistEntry** items - I’ll only need the first 3.

The **Refresh** item will control when to reload all the data. There will also be manual refresh button.

So the function that needs to happen on Load will put the info in the dynamic text fields.  
**TrackOne, TrackTwo, TrackThree** are my text fields. I’ll be combining the variables something to the effect of **title & " - " & artist & " - " & album**.

Anyone have any AS ideas for this?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 9:36pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/10 "2003-01-21T21:36:46Z")

</div>

Ok… I’m making progress. I’ve found that the problem with the tutorials is that they’re not explaining how to target specific nodes… the old fashioned way. I’ll explain later.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 9:44pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/11 "2003-01-21T21:44:39Z")

</div>

> \*Originally posted by shuga \*  
> \*\*thought i’d make that lil graphic for ya =)

for all the times you’ve helped me out

\*\*

LOL… I saved it. Thank you for that 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 21, 2003, 9:52pm UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/12 "2003-01-21T21:52:08Z")

</div>

anytime ![](http://www.roughedout.com/betaspin.gif) =)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 22, 2003, 12:24am UTC](https://forum.kirupa.com/t/xml-in-flash-is-for-rocket-scientists/11736/13 "2003-01-22T00:24:26Z")

</div>

Ok. I’ve actually got it working. I’m hardcoding the XML actionscripts - most of the tutorials do it dynamically - and that’s where it gets confusing.

I’ll post my findings soon.

So, another question about making a timer. When I load the XML file, I have a number that tells me when I should reload the file (in seconds). What’s the best way to do this? Do I just loop several frames and check the getTimer? Is there some easier AS to do this?

Thanks,  
Lex
