dcsimg
A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Grabbing URL encoded data

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    27
    I need my flash movie to grab data from it's own URL much like a server script would (i.e. http://www.domain.com/flash.swf?data=value). I thought I remember reading once that there's an action script to do this automatically but I can't find any information on how to do this.

    Is there a way or do I have to write an actionscript to parse the data?

  2. #2
    Junior Member
    Join Date
    Feb 2001
    Posts
    27

    Never Mind....

    Never mind, I figured it out.

    loadVariablesNum (_url, 0);

  3. #3
    Senior Member catbert303's Avatar
    Join Date
    Aug 2001
    Location
    uk
    Posts
    11,222
    I'm not sure about an actionscript but you can do this in the html that embeds the movie in the page. If you have a page like http://www.mydomain.com/flashpage.php?data=value

    you could use php to write the object/embed tags like

    <?php
    $data = $HTTP_GET_VARS['data'];
    ?>
    <object .....
    <param name="movie" value="mymovie.swf?<? php echo "data=$data"; ?>">

    and similarly for the movie address in the embed tag. You will now have the variable data with the value "value" in your movie.

    You don't have to use PHP I think the same would be possible with javascript. I believe location.search will return the query string from your url which you would then be able to pass to the flash movie in the same way as the php example using document.write.

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