PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hey, does anyone know how to get varibles from a URL to be passed into flash using php?? For example, if I want to get a member's ID to load the information for that member into flash the url would be http://www.mysite.com/member.php?mid=32.
Anyone know a way to get the mid number as 32 to load into flash as a variable?? If you have any clue as to how to do this let me know. Any help is much appreciated!
sure very simple
when u embed the flash in your php page
u have id="myflash.swf"
all u have to do is :
id="myflash.swf?mid=<?=_REQUEST['mid']?>"
when the page will load and the flash will load
theflash will have automaticlly a variable called mid with the given value
enjoy
Don't forget that if you add variables to the Flash movie URL then browsers will see that as the actual file name, and because of this the browser will think it's a new file a reload the entire movie whenever the URL (or attached variables) change.
If your movie is small this isn't a problem, but if it takes a while to load I would suggest creating a 'base' movie (a blank swf which will loads another swf file depending on the variable(s) you send to it).
Yeah there are lots of ways of getting vars into Flash... tagging them to the Flash file name is the easiest way but it can also be done via JavaScript or by loading a PHP page directly into Flash... which is how a lot of 100% flash-based sites work.