2 Replies Latest reply on Apr 14, 2007 4:47 PM by masterkrang

    dynamically loadVars directly from hypertext link?

    masterkrang Level 1
      Hi, I have created a swf that keeps track of a users choices, then sends the coices to a PHP script via getURL. When the php script recieves the vars, it sends the user an email with a with a hypertext link. This hypertext link has the choices they made appended to the url. The URL ends up looking something like this in their email:

      mysite.com/shirtmaker.swf?email=theiremail@email.com&shirtsize=small&shirtcolor=black

      As you can see the URL leads directly to a swf on mysite. Keep in mind that this is anentirely different swf than the one the user initially made their choices in.

      My question is, can I load the variables from the URL directly into the swf using loadVars? or any other method? Or do i have to first catch the variables in a script, then relay them to the swf?

      Right now, the loadVars method isn't working.

      Here's the code within the swf (the one i refered to earlier: mysite.com/shirtmaker.swf):

      One of the requirements of this job is to get the vars into the swf from the user's email message (where i placed the hypertext link based on their order). The idea behind it is that the customer can always use the hypertext link to view what they ordered. Instead of storing their results in a database, the information is stored in their email in a hypertextlink, and if they want to see it, a swf file can dynamically generate it upon clicking. This way their is only one php script and one swf.

      Thank you in advance for your response.

        • 1. Re: dynamically loadVars directly from hypertext link?
          Greg Dove Level 4
          I understand what you're trying to do... but I suspect its probably best to have the email link to another php script which takes the same URL parameters and just returns the html page to the browser with the swf embedded inside it and the those same parameters set up for the alternate swf, rather than linking directly to the swf like that. I'm only just starting to learn php so can't give you a example sorry, but that's the way I'd approach it.

          In theory, if the browsers are OK with it, then it should pass the variables into flash with the parameters appended like that, but I haven't tried it with a direct link to the swf. You shouldn't need loadVars if you're just loading them into the swf like that.
          • 2. Re: dynamically loadVars directly from hypertext link?
            masterkrang Level 1
            Thanks for the quick reply! I'm so happy because I just skipped loadVars altogether and it worked. Thanks a lot!

            I wonder what the downside might be to this? It seems much more simple than using loadVars, and it seems often that people are only sending a few variables.

            Very cool