A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: More Variable Problems :(

  1. #1
    Member
    Join Date
    Jul 2001
    Posts
    37
    Hi,

    I know this seems to be a popular topic today, but I have been trying to pass variables from a Flash movie in a HTML page to another Flash movie in a HTML page.

    I used a hyperlink in the HTML page to test it e.g. <a href="page2.htm?value=1" target="_parent">Test</a> and it works fine with Flash receiving the value.

    When I came to test it in Flash, however, I used a button action with a getURL command:
    on (release) {
    getURL ("page2.htm?value=1", "_parent", "GET");
    }

    Using the Flash version, the second page opens fine although the ?value=1 isn't passed out of Flash. Does anyone have experience of passing values using e.g. ?value=1, as I have tried various things and can't seem to get it to work.

    Thanks in anticipation,

    Danny

  2. #2
    Senior Member
    Join Date
    Jun 2001
    Posts
    136
    I'm not exactly sure what u're trying to do there, as the variable your passing is actually in the query string of the browser url, rather than being passed into another flash movie.

    Therefore I don't see any way that the hyperlink you created for testing could possibly work, unless you had javascript passing on the query string variable into the flash embed, or setting it inside the flash object with an onload event. Alternatively I guess it would work if you had page2.swf?value=1 instead, but that's prob not what u want.

    There's a lot of ways to pass a variable from one flash movie to another, but it would prob make the most sense if you take what you've got, and add the javascript code to push the url query string into your flash object.

    I don't have time now to write an example but you can use "location.search" in javascript to extract the url query string, and then either tag it onto the end of the flash embed line, or use setVariable to set it inside your flash object.

    Hope that makes sense.

    Mike

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