Skip to main content
Robo-X
Participant
January 28, 2010
Question

Problem passing Parameters to SWF file

  • January 28, 2010
  • 1 reply
  • 370 views

I got a really newbie question.

I want to open a .swf file with a parameter for instance test.swf?beer=good and set "good" (the "good" parameter is going to constantly change) as a variable in the script so that I can add it to the stage in the swf file. The problem is I can't seem to figure out how to read the parameter so that it can be placed in the script.

For instance I have it set to:

var beer = "";

on (release) {

getURL("http://www.google.com/search?&q="+ beer  , "_self");

}

Can anyone please help me or maybe point me to a help file/ tutorial how to do it?

Thanks in advance

//Rob

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
January 28, 2010

use a javascript function to return location.href and use the flash externalinterface class to call that js function.  you can then use the flash string methods to parse your query string.