2 Replies Latest reply on Mar 26, 2011 12:54 AM by benk1234

    How to pass parameters to a Flex .swf application from HTTP response

    benk1234

      I am writing a simple HTTP server that returns a default Index.swf file in a standard HTTP response packet w/ "content-type: application/x-shockwave-flash" the followed by the .swf file binary. Everything is working fine. However, if I want to also pass in some server side parameter (e.g. IP address of the servering server) to the Flex application when it runs in client's browser,then I hit the brick wall...

       

      On the flex side, I put the following AS code:

       

          var serverUrl:String = Application.application.parameters.serverURL;

       

      So far I tried and failed all the following methods in the HTTP response header:

       

          serverUrl: 12345

          location: http://10.10.10.10/test.swf?serverUrl=12345

          referer: http://10.10.10.10/test.swf?serverUrl=12345

          flashvars: serverUrl=12345

       

      Nothing works. Has any guru out there knows about the trick to do that.

       

      Thanks in adavnce,

       

      Ben