A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: XML sendAndLoad and relative path

  1. #1
    Junior Member
    Join Date
    May 2006
    Posts
    5

    XML sendAndLoad and relative path

    Hello,

    I use the XML sendandload function but it only works with absolute path.
    If I use the code
    Code:
    	formValuesXML.sendAndLoad("process.php", loginReplyXML);
    than it fails but if I use the
    Code:
    	formValuesXML.sendAndLoad("http://test/oop/process.php", loginReplyXML);
    than it works fine.
    The swf and the php files are in the same directory.

    Any idea?

    Thanks!

    PS:
    I don't want to use absolute path as I want to use this code on more sites and don't want to edit one-by-one if I have to change it.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    Los Angeles
    Posts
    86
    Not sure if print_r($_SERVER); gives you exactly the full path, but You could do something like :

    <div id="flashcontent">This text is replaced by the Flash movie.</div><script type="text/javascript">
    var so = new SWFObject("swf/movie.swf?Qpath=<? print_r($_SERVER); ?>", "mymovie", "760", "500", "7", "#ffffff");
    so.addParam("wmode", "transparent");
    so.write("flashcontent");
    </script>


    then in your movie do this:
    formValuesXML.sendAndLoad(_root.Qpath, loginReplyXML);


    the idea is to use php to dynamically get the url and then feed the value into the flash movie using a querystring value. I am not aware of a way to get the value directly with actionscript.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center