Go Back   Northcode Support > SWF Studio V2 (Closed)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Old 2001-07-16, 12:26 PM   #1
Vaughn
Registered User
 
Join Date: Jul 2001
Posts: 32
How can I pass paramaters to the exe file I make when I run it from another application?

And when I do, how do I gain access to them inside my flash file?

thanks!

-v
Vaughn is offline  
Old 2001-07-16, 12:45 PM   #2
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 12,047

You can only pass parameters to an EXE files on its command line. Inside Flash you can access the command line that was passed to you at startup using the CMDLINE command (www.northcode.com/studio/help/commands/cmdline.html). This gives you the raw command line, parsing it for the values you want is up to you.

northcode is offline  
Old 2001-07-16, 12:52 PM   #3
Vaughn
Registered User
 
Join Date: Jul 2001
Posts: 32
I looked at the link you gave me, and I don't really understand what a command line is, pardon my newbieness on that. I guess what I want to know is can I do this from another flash movie,

fscommand("exec", "mySwfStudioFile.exe\tvar1\tvar2");

And does the var1 var2 end up on the command line to be accessed by the CMDLINE fscommand?

-v

Vaughn is offline  
Old 2001-07-16, 01:06 PM   #4
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 12,047

In SWF Studio you don't need to use tabs between your parameters, you can use spaces as the DOS gods intended And, yes, the stuff that appears after the EXE is the command line and will be passed to "myexe.exe".

fscommand("RUN", "myexe.exe var1 var2")

If myexe.exe in the RUN command above was an SWF Studio exe then you could use the CMDLINE command to read the command line.

fscommand("CMDLINE", "stuff");

The fscommand above places the contents of the command line in a Flash variable called "stuff" which you can use in your actionscript.

Notes:

All variables created by SWF Studio commands are at the root level. If you used CMDLINE example above in a movie clip you would need to access _root.stuff to read the command line.

Flash does not populate variables after calling fscommands immediately. You will need to wait a couple of frames before accessing the variable. You can do this with a simple frame loop. There's an example frame loop in one of my replies here http://www.northcode.com/forums/show...hp?threadid=19


northcode is offline  
Old 2001-07-16, 01:25 PM   #5
Vaughn
Registered User
 
Join Date: Jul 2001
Posts: 32
But how do I declare a certain variable to a certain value?

with flash I'd have
http://www.domain.com/flashfile.swf?var1=one&var2=two

so how would I send var1 = one through a command line?

-v
Vaughn is offline  
Old 2001-07-16, 03:56 PM   #6
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 12,047

You could do it like this...

cmdline = var1 + " " + var2;
fscommand("RUN", "myexe.exe " + cmdline);

The command line is free form text so you don't need to use the loadVariables format, you can just separate them with blanks or whatever you like.

northcode is offline  
Old 2001-07-16, 04:03 PM   #7
Vaughn
Registered User
 
Join Date: Jul 2001
Posts: 32
We are having confusion again,

I will not be opening my SWFStudio exe with the run command, because I will be using an actual Flash exe, not an Studio exe, to run the Studio exe.

So I won't have a RUN command to use.

And that's not where I am having trouble, that's the easy part, what I need to know is how do I turn Var1 on the command line into--

_root.var1 = one

--in the flash file inside my Studio exe file?

I am sure this is really basic, but it's news to me, I'm used to internet programming and application programming is throwing me for a loop.

-v
Vaughn is offline  
Old 2001-07-17, 12:48 PM   #8
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 12,047

Okay, then you have to fall back on EXEC and using tabs to separate your parameters. I've created an example you can downloda from http://www.northcode.com/cgi-bin/dlo...es/cmdline.zip to show you how to parse command line arguments and use them in Flash.

northcode is offline  
Old 2001-07-17, 04:02 PM   #9
Vaughn
Registered User
 
Join Date: Jul 2001
Posts: 32
I used your example and when testing it, if I create the cmdline.exe without standalone selected, it doesn't show that it got anything from the commandline,

but if I set it back to standalone, it works fine, without changing any code.



-v
Vaughn is offline  
Old 2001-07-17, 05:02 PM   #10
northcode
Tim
 
northcode's Avatar
 
Join Date: May 2001
Location: Ottawa
Posts: 12,047

It works without stand-alone if you don't use TAB as a delimiter (which you need to do in Flash if you don't use SWF Studio).

I ran my tests from a DOS prompt so I never tried using TAB as a delimiter. The fix is quite simple.

I'm creating a bug for this one.

northcode is offline  
Old 2001-07-17, 05:05 PM   #11
Vaughn
Registered User
 
Join Date: Jul 2001
Posts: 32
thanks, I'll try that out. (not using the tabs)

-v
Vaughn is offline  
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes