PDA

View Full Version : passing XML via PHP to Flash app, help pls



cybertao
June 17th, 2003, 04:46 PM
I need some help with working out how to pass XML to flash via PHP from a different domain. I want to load it into the actionscript XML object but because of the security issues it doesn't allow for this.

Has anyone got any experience with this so I can be put in the right direction, not having much luck at the mo.

Thanks for any help

cybertao
June 20th, 2003, 11:41 AM
Simple questions not allowed...

Looks like I'm going to have to finally get round to studying php for real.

:cyborg:

Jubba
June 20th, 2003, 12:09 PM
I actually missed this thread. Sorry boss...

I don't think you can. PHP does not handle remote file locations and if you try to call XML from Flash directly from a different domain you get a sandbox error....

λ
June 20th, 2003, 12:43 PM
Macromedia have a technote on this: Loading Data across Domains (http://www.macromedia.com/support/flash/ts/documents/load_xdomain.htm#proxy)

And it can be done with PHP.

cybertao
June 20th, 2003, 02:50 PM
njs12345:
That's it! Didn't think of Macromedia as they have nothing to do with PHP but now you mention them and thinking about the wonders they've done with DWMX by incorparating PHP and mySQL shortcuts that write chunks of code and keep with the variables they must of got a tech note on redirecting XML to flash somewhere.

Just thought this question was too simple for most of you here as I'm only just getting down to serverside scripting, didn't mean to sound arrogant, just getting a bit pissed with all the walls I'm coming up against at the moment. Teething challenges you could say. :)

cybertao
June 20th, 2003, 03:04 PM
Thanks njs12345 the link was just what I needed.



$dataURL = "http://www.macromedia.com/desdev/resources/macromedia_resources.xml";

readfile($dataURL);


Didn't realise it was this easy.

:)