XML in Flash is for rocket scientists

… 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

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:

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]

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

"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.

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.

beta’s fuzzy lil head spinning … that’s a great image

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:

Hey, you put my head in your post :stuck_out_tongue:

Now my head is spinning even more :o

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”>Book Link Here</a>
<br><br>
It’s the best description of the subject I have found so far.
<BR><Br>
Hope this helps.

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

for all the times you’ve helped me out

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?

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.

*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 :slight_smile:

anytime =)

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