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... :-/
later!
Mr Helpy mcHelpson - 31 May 2007 01:06 GMT
your php file can easily pass this by tagging it onto the end of the file path
string.
whatever.swf?variableA=10&variableB=20
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.
DZ-015 - 31 May 2007 15:35 GMT
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?
Mr Helpy mcHelpson - 31 May 2007 18:30 GMT
your variables will appear on the root timeline. its that easy :)