SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Dec 2004
    Posts
    419
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Querystring problem in ActionScript 2

    Sorry - also posted here, but getting no replies:
    http://www.actionscript.org/forums/s....php3?t=215473

    I've been working with this tutorial:
    http://www.permadi.com/tutorial/flas...ing/index.html

    Using AS1, I've been able to extract a variable from a SWF, e.g. the SWF has a querystring associated with it, in the HTML of the web page on which it is embedded:

    Code:

    Code:
    <param name="movie" value="loaderInfoExample.swf?userName=TestUser" />
    <embed src="loaderInfoExample.swf?userName=TestUser" ....
    It's easy to get the variable into AS1 - it's just there, without doing anything.

    I've tried to do the same in AS2, but I can't get it to work, using Permadi's page.

    All I want to do is to get the value of the 'userName' var from the SWF Querystring, into a variable in the SWF.

    Any advice about the AS syntax to use would be much appreciated. The example on the Permadi page didn't work - I may have been doing something very wrong of course.

    I have attached an example fla, swf and html file to show my issue.

    Thanks
    Attached Files Attached Files

  2. #2
    SitePoint Evangelist ferrari_chris's Avatar
    Join Date
    Mar 2008
    Location
    NP, New Zealand
    Posts
    576
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you want to use is FlashVars, which this AS1 querystring example may have morphed into at some point.

    I've written an article about FlashVars and how to use them. Check it out: http://fcOnTheWeb.com/articles/flashvars/

    It involves outlining the variables as separate entries in the embed code for Flash rather than tagged onto the SWF name. And they're just as easily accessible in Flash as before.


Bookmarks

Posting Permissions

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