12

Is it possible to pass flashvars to standalone flash player via the commandline? Among other reasons, I want to run some unit tests from the command line.

I have done some Google searches, the question has been asked before but no answer that I can find.

user492922
  • 925
  • 2
  • 12
  • 23
  • possible duplicate of [How to pass parameters to a Flash projector (Windows)?](http://stackoverflow.com/questions/1089578/how-to-pass-parameters-to-a-flash-projector-windows) – Ingo Karkat Jan 11 '15 at 13:51

2 Answers2

17

Yes, I figured this out today(Say you have a flashvar called "p"):

flashplayer.exe "file://c:\myswf.swf?p=100"

Works for the linux flashplayer too...

Jon
  • 171
  • 1
  • 4
1

Try to pass command-line parameters to an .exe projector.

Alternatively, you might want to wrap your .swf on another, and have the wrapper load it with parameters, like this:

var loader:Loader = new Loader();
var request:URLRequest = new URLRequest("your_cool_app.swf");
request.data = "a=1&b=2"
loader.load(request);
Julio Santos
  • 3,837
  • 2
  • 26
  • 47
  • What does "Try to pass command-line parameters to an .exe projector" mean? "./flashplayer foo.swf?qux=baz" doesn't work. Thanks for the second suggestion, though less than ideal (I have to write a new swf for every change parameters) I may be able to make it work in my case. – user492922 Oct 31 '10 at 22:46
  • It means publish it as an .exe executable, and run it in the command line with parameters. – Julio Santos Oct 31 '10 at 22:53
  • This isn't a real answer. – Jotham Aug 06 '14 at 22:17
  • The answer functions, now I can load the variable at the another SWF with this sentence: [code]Object(root).loaderInfo.parameters.variable_name + "";[/code] – frss-soft.com Mar 26 '16 at 18:59