11 Replies Latest reply on Oct 6, 2006 7:44 AM by Newsgroup_User

    Flash and HTTP Variables

    ndisdabest
      Hi --

      I'm looking to embed a Flash file that has the capability of figuring out where my hits are coming from. For example, in PHP, this would be the HTTP_REFERER variable that you can pull in using $_SERVER type commands.

      I'm not sure if Flash has this capacity or not. If it does, and someone could point me in the right direction, it'd be greatly appreciated. Likewise, if it is NOT possible and someone could offer an idea or two for how they'd accomplish this, I'd be equally as grateful :)

      Thanks!
        • 1. Re: Flash and HTTP Variables
          Level 7
          ndisdabest,

          > I'm looking to embed a Flash file that has the capability
          > of figuring out where my hits are coming from. For
          > example, in PHP, this would be the HTTP_REFERER
          > variable that you can pull in using $_SERVER type
          > commands.

          Check out the LoadVars class in the ActionScript 2.0 Language Reference.
          You can communicate with PHP (POST or GET) same as any HTML page. Put
          something together in PHP that returns the values you want, then post to
          that page with a LoadVars instance.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Flash and HTTP Variables
            AnandMX Level 1
            Just check LoadVars class with a valid PHP page which return u $_SERVER data.
            • 3. Re: Flash and HTTP Variables
              ndisdabest Level 1
              The problem I am running into is that I need to insert this Flash file into a template page that will not allow me to add dynamic PHP or ASP elements. So, in other words, I cannot embed this Flash inside of a PHP page... for all intents and purposes, it's basically going to be sitting inside a standard HTML file. Ultimately, I need to use the Flash to communicate with a PHP file on another server to collect the information I need.

              (Confused yet?)

              David -- Will the idea you provided work in the setup I described?
              • 4. Re: Flash and HTTP Variables
                Level 7
                Cant you just pass the referer as an argument/parameter to the embedcode
                or use flashvars?

                Like :

                <param name="movie" value="app.swf?referer=yadayada" />
                and
                <embed src="app.swf?referer=yadayada"

                or:
                <PARAM NAME=FlashVars VALUE="referer=yadayada">
                and
                FlashVars="referer=yadayada

                I doubt the http_referer will yield any usefull results if the swf from
                the same domain does the request to a PHP file which then checks the
                referer.

                Manno

                David Stiller wrote:
                > ndisdabest,
                >
                >> I'm looking to embed a Flash file that has the capability
                >> of figuring out where my hits are coming from. For
                >> example, in PHP, this would be the HTTP_REFERER
                >> variable that you can pull in using $_SERVER type
                >> commands.
                >
                > Check out the LoadVars class in the ActionScript 2.0 Language Reference.
                > You can communicate with PHP (POST or GET) same as any HTML page. Put
                > something together in PHP that returns the values you want, then post to
                > that page with a LoadVars instance.
                >
                >
                > David Stiller
                > Adobe Community Expert
                > Dev blog, http://www.quip.net/blog/
                > "Luck is the residue of good design."
                >
                >

                --
                ----------
                Manno Bult
                manno@xs4all.nl
                • 5. Re: Flash and HTTP Variables
                  Level 7
                  Manno,

                  > Cant you just pass the referer as an argument/parameter
                  > to the embedcode or use flashvars?

                  Wow. Yup! :-p Man, that's so much less hassle than my suggestion.
                  Thanks for bringing it up. Terrific idea.


                  David Stiller
                  Adobe Community Expert
                  Dev blog, http://www.quip.net/blog/
                  "Luck is the residue of good design."


                  • 6. Flash and HTTP Variables
                    ndisdabest Level 1
                    Thanks for your help everyone. Manno, your post prompted me to start a new thread that you can find here: http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=15&catid=194&threadid =1202357&enterthread=y

                    Upon second glance, the REFERER tag will do little for what I'm actually trying to accomplish with this. What I REALLY need to do is read a cookie...
                    • 7. Re: Flash and HTTP Variables
                      Level 7

                      To bad it wasn't of any help :)
                      Now, let's wat untill the new thread gets to the newsserver... Is that
                      some kind of scheduled process?

                      Manno

                      David Stiller wrote:
                      > Manno,
                      >
                      >> Cant you just pass the referer as an argument/parameter
                      >> to the embedcode or use flashvars?
                      >
                      > Wow. Yup! :-p Man, that's so much less hassle than my suggestion.
                      > Thanks for bringing it up. Terrific idea.
                      >
                      >
                      > David Stiller
                      > Adobe Community Expert
                      > Dev blog, http://www.quip.net/blog/
                      > "Luck is the residue of good design."
                      >
                      >

                      --
                      ----------
                      Manno Bult
                      manno@xs4all.nl
                      • 8. Re: Flash and HTTP Variables
                        ndisdabest Level 1
                        Manno -- Your post actually was a huge help... I realized that I was approaching this problem incorrectly. So, thanks! Would appreciate it if you could take a look at the new post for me!
                        • 9. Re: Flash and HTTP Variables
                          Level 7
                          Manno,

                          > To bad it wasn't of any help :)
                          > Now, let's wat untill the new thread gets to the newsserver... Is
                          > that some kind of scheduled process?

                          It is scheduled, yeah. Just an unfortunate fact of life. If the web
                          version weren't available, you have to wonder how the volume of questions
                          would change.


                          David Stiller
                          Adobe Community Expert
                          Dev blog, http://www.quip.net/blog/
                          "Luck is the residue of good design."


                          • 10. Re: Flash and HTTP Variables
                            Level 7


                            David Stiller wrote:
                            > It is scheduled, yeah. Just an unfortunate fact of life. If the web
                            > version weren't available, you have to wonder how the volume of questions
                            > would change.

                            It just feels good to complain once in a while :) If you stick to one of
                            the two methods chances are won't notice. Just the occasional wrapped
                            links and forum style tags...
                            Still, the speed of newsreaders kicks the web interface's behind anytime...


                            --
                            ----------
                            Manno Bult
                            manno@xs4all.nl
                            • 11. Re: Flash and HTTP Variables
                              Level 7
                              Manno,

                              > It just feels good to complain once in a while :)

                              Ha ha! It does.

                              > If you stick to one of the two methods chances are
                              > won't notice. Just the occasional wrapped links and
                              > forum style tags...
                              > Still, the speed of newsreaders kicks the web
                              > interface's behind anytime...

                              I'm with ya. That's why I use a news client over 95% of the time. I
                              definitely recommend it.


                              dps