3 Replies Latest reply on May 31, 2007 10:30 AM by crazyjoemilan

    Passing parameters...

    DZ-015 Level 1
      Hey all,

      I'm working on a flash based picture gallery for a fairly specific website. The client submits text and images by way of a form into a database. PHP later renders an XML index of the paths to that data which my SWF file downloads. This works great on a broad level... but every time the player is used, it works the same.

      It would be great if I could have a PHP container html file, which would be able to pass parameter or two to my SWF file right off the bat... for instance, and index number... and that would give me a way to customize the player based on it's path in the browser.

      So, the question is, can the html/php container pass a parameter (or a few parameters) to an SWF file?

      Sorry this was so long - I'm not sure why, but I gave a lot of context this time... :-/

        • 1. Re: Passing parameters...
          crazyjoemilan Level 2
          your php file can easily pass this by tagging it onto the end of the file path string.


          if that is your .swf path instead of "whatever.swf," it will pass the variableA and variableB with values 10 and 20 respectively. Now, as I'm sure you see, you'll have to swap out the values with some php/javascript but the method remains.

          Also, note you'll need the same additions in both instances where your .swf path is named.
          • 2. Re: Passing parameters...
            DZ-015 Level 1
            Perfect - and will I have to do anything interesting in flash to get access to those variables, or will (in the case of your example) I just automatically have access to "variableA" and "variableB" in my swf file?
            • 3. Re: Passing parameters...
              crazyjoemilan Level 2
              your variables will appear on the root timeline. its that easy :)