How on earth do I get the parameters out of the querystring?

  • ShawnJC
  • Newbie
  • Newbie
  • User avatar
  • Joined: Sep 12, 2004
  • Posts: 5
  • Status: Offline

Post May 31st, 2005, 9:10 am

Constrictor. I'm a little confused on how your method works. You are saying that first you post variables via the URL query string (In the address bar, not in the flash HTML tag) and then receive that variable in PHP. Is the flash movie embedded in this php page that is receiving variables from the query string?
Then you said that you use php to echo something back to the page. Will this be visible by the users?
I am just curious as I have never seen a method of sending variables to php then to flash with GET and then loadVars. The only way I knew of doing it (with full compatibility) is to send it to a php page in the URL query string, then use php to echo the variables into the flash MOVIE= tag as query string variables.
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post May 31st, 2005, 9:10 am

  • contstrictor
  • Novice
  • Novice
  • No Avatar
  • Joined: May 23, 2005
  • Posts: 26
  • Status: Offline

Post June 3rd, 2005, 12:51 pm

Nope it's not, my suggestion is this.
You have a flash movie with the variables you wanna work with use the LoadVars Method and load it to a different php script you have written to work with the variables. eg
Code: [ Select ]
var varsOut:LoadVars = new LoadVars();
var varsIn:LoadVars = new LoadVars();
//varsIn is there if you want to use anything php returns
varsIn.onLoad = function(success){
if(success){
trace(varsIn.phpvariable);
}else{
trace("error loading from php");
}
}
/*Then this is where you send the variables to php and collect whatever php spits out whether its from a MySQL database or encryption or whatever....*/
varsOut.sendAndLoad("pathToPHPScript",varsIn,"POST");
  1. var varsOut:LoadVars = new LoadVars();
  2. var varsIn:LoadVars = new LoadVars();
  3. //varsIn is there if you want to use anything php returns
  4. varsIn.onLoad = function(success){
  5. if(success){
  6. trace(varsIn.phpvariable);
  7. }else{
  8. trace("error loading from php");
  9. }
  10. }
  11. /*Then this is where you send the variables to php and collect whatever php spits out whether its from a MySQL database or encryption or whatever....*/
  12. varsOut.sendAndLoad("pathToPHPScript",varsIn,"POST");

and that's it.
  • ShawnJC
  • Newbie
  • Newbie
  • User avatar
  • Joined: Sep 12, 2004
  • Posts: 5
  • Status: Offline

Post June 3rd, 2005, 1:00 pm

Ok, yes I understand that, however I think this question is regarding getting the variables from the query string. In order to do that I think the only way is to write the query string variables from the URL into the flash movie tag from which there flash will receive the variables. For instance if you have a flash movie that displays a different image depending on which link you click on a PREVIOUS page you might find this way easier to post some variables in the query string like "test.com?image=1" from the link on the previous page. Then the flash movie tag could have
<param name="movie" value="somefilename.swf?image="<?=$imageName?>>
in which the $imageName variable is taken from the url query string in the server side language of your choosing. Flash will then have the image variable with the value selected in the _root of the movie. This would of course have to be done with the embed tag as well as the object tag.
  • contstrictor
  • Novice
  • Novice
  • No Avatar
  • Joined: May 23, 2005
  • Posts: 26
  • Status: Offline

Post June 5th, 2005, 2:27 pm

Well i haven't fully explored that area yet. So yes maybe you're right about that, it makes sense. I was simply suggesting a method that has worked for me and i prefer it because i can work with such variables however i like eg: Letting the user know what is loading where etc etc.

Post Information

  • Total Posts in this topic: 19 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.