A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: loading external file from diferent domain name

  1. #1
    Member
    Join Date
    Jul 2002
    Posts
    61
    If u upload text file and swf files in one domain name its working fine. If i uploaded in different domain location message is not displaying in flash file.

    In my flash file i add this script in first frame to load external file

    loadVariablesNum("http://www.domainname/textfile.txt", 0,);

    I've hosted text file in this domain name address and flash file in my domain name address, but the external message is not displaying.

    Pls. give me an idea. I hope u'll reply to solve my problem

    Thx sathish


  2. #2
    NerdInside's Avatar
    Join Date
    May 2001
    Location
    Penguin Island
    Posts
    3,439
    Flash doesn't allow remote linking.

  3. #3
    Senior Member
    Join Date
    Aug 2002
    Posts
    191
    for the web it wont work. But if you play the .swf file in the Flash Player on the client side machine it would work.

  4. #4
    Member
    Join Date
    Jul 2002
    Posts
    61

    is it possible to retrive message from xml file

    Hi thx for ur reply.

    Can i retrive message from xml file that's located on another server and displayed on flash web page.

    I hope u'll give an idea.

    thx
    sathish

  5. #5
    Senior Member
    Join Date
    Jun 2000
    Posts
    687
    Sure - but you'll have to use sometype of proxy script.

    1 example:

    loadVariablesNum("proxy.php", 0);


    - proxy.php would look like:

    < ?
    header("http://www.domainname.com/textfile.txt");

    ?>

    This would be the equivalent to the first post. As it would just load whatever was located at the domainname.com/Textfile.txt - right into your movie. Same would be true for an xml file.

    If you wanted to get a bit more complicated you can change that over to something like:

    < ?
    $URL = "http://www.domainname.com/textfile.txt";

    $fp = fopen( $URL,"r");
    $Results = fread($fp, 800000);
    fclose( $fp );
    print "$Results";
    ?>

    If you need to POST variables to a different domain it gets a bit more complicated but is possible.



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