Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reloading XML document

Status
Not open for further replies.

thumpkidd9

Programmer
Mar 27, 2005
42
US
Hey guys,

I've spent most of the night trying to figure this one, thought I might hop on here to get some suggestions.

My flash file is reading a from an .xml file to pull a music playlist. The xml file will be getting updated when a user add/removes items from their playlist which is coded in PHP. I was looking for a good way for my flash music player to keep updated with the XML playlist file that is generated in php. Currently I have it setup to load the playlist during initiation of the flash file. I can't use more than one frame in the timeline (or at least I think I can't) as it will interrupt the streaming music when looping.

Any ideas would be appreciated.

Thanks,
¬MP
 
Put the code to read the XML into a global function. You will be able to call the function from anywhere in your code at anytime that way...

_global.getXML - function() {
//code to grab data//
}

As far as when it gets pulled, if you are using remoting for your PHP connections, then have the program run the function when Flash gets a result :

AS2.0

function MyRemotingFunction_Result(result) {
_global.getXML();
}

... or, you can setup a function called an interval that will grab the XML data every 10 seconds, 30 seconds, 1 min, etc.

Check Flash's help files for setInterval() for how to do this.

Hope this helped.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top