Search  

XML PHP ISSUE

HomeForumsItem DiscussionXML php issue
Default-profile jdd
2 posts
Bought between 1 and 9 items

Anyone have issues uploading a .swf that access an xml file for data, and the data for the swf loads just fine, unless it is referenced outside of its own directory?

Example: this works when hitting it directly http://www.jdanieldavidson.com/flash/jambox/XML_jambox.php

this does not: http://www.jdanieldavidson.com/index.php?que=jambox

It loads the swf, but the swf does not seem to read the xml file.

thanks, dan

Posted about 1 month ago
29459 dxc381
360 posts
Exclusive author Author was featured Referred at least one person Sold between 10 000 and 50 000 dollars Bought between 1 and 9 items
Yeah. It’s a Flash permissions thing and it drives me crazy. I usually just call a php file that calls the xml file. Here is the php code I use:
<?php
    $xml = file_get_contents('pathToXml.xml');
    print_r($xml);
?>
Good luck. Posted about 1 month ago
56874 flashstar
69 posts
Sold between 100 and 1 000 dollars

It’s about the relative paths . I always have this problem . You mush correct the loading paths . Let’s say you have the folowing : a.swf loading b.swf in the directory called modules. In the modules directory sits the b.xml file loaded by b.swf.

Now : opening a.swf will load b.swf , but not it’s b.xml ; opening b.swf alone loads b.swf ; this is because a.swf thinks that b.xml is in the root directory , not in the modules directory .

Correct this way : in the b.swf , change XML .load( fileName ) , with this snippet : http://pastie.org/288245 .

Job Done !

Posted about 1 month ago
Default-profile jdd
2 posts
Bought between 1 and 9 items

Thanks for your input and quick responses. Greatly appreciated.

-dan

Posted about 1 month ago