Copy link to clipboard
Copied
Hello All,
I use Flash Builder 4.7 as my IDE. I use AirSDK 3.4 along with Feathers, Starling, and a video extension. I intend to use my app as a standalone desktop app and I think/hope that I have set it up correctly.
I'm having the hardest time understanding how to use fscommand(). I understand how to fill the parameters of the functions but as for how to setup the fscommand folder which will contain all the .exe, I'm lost. I will attach a screenshot of my folder structure.
I read somewhere that in order to use fscommand, you have to use a flash projector (.exe) instead of a .swf. Does that mean I can't run my program in debug mode and I have to publish it in order to test it. I guess I'm confusing myself with .exe and .swf. Also, I keep reading the need to use a program from northcode. Is this true and what exactly does the program do?
What I'm trying to do is load some .exe games from my code and put it into my program window. Is this possible? I have an exercise bike hooked up with sensors that'll send keyboard commands to my flash program. I want to be able to use the exercise bike to play racing games like Mario Kart. The reason I'd like for it play from my program window as opposed to playing it directly from the .exe game's native window is in my flash program, I've already written functions that'll convert the keyboard commands into real world data such as speed, distance, lap time, etc.
Any help would be greatly appreciated!
Also, it would be awesome if anyone could point me to an up to date tutorial of fscommand(). I see lots of tutorials but they're all from 2008 or earlier. If nothing, I'll try and write a tutorial myself after this.
Many thanks!
Kevin
1 Correct answer
I might be getting a bit ahead of myself. A flash projector cannot launch another executable "inside" itself. It can merely launch an executable, but then has no actual control or connection to it. This being the case, I was presuming you were already running Flash inside a more capable wrapper, like a visual c# or VB app that is displaying Flash via an ActiveX control (hence the link).
If you're not doing what I described above then ExternalInterface won't help. It (and fscommand) has the abili
...Copy link to clipboard
Copied
ExternalInterface is the successor of fscommand and you should consider either using that, or AIR and Adobe Native Extensions. When you start talking about controlling or communicating between OS processes, some of which are not Flash/AIR, it gets a little more complicated. AIR/Flash can talk to other instances of itself but between other applications is different.
If you wrap this application in an ActiveX instance via another language, ExternalInterface will be able to communicate with its parent. Here's some information on that communication medium:
Adobe ActionScript 3.0 * Example: Using the external API with an ActiveX container
Copy link to clipboard
Copied
Thanks for the reply! I looked at ExternalInterface and it seems that it is used for flash webpages to access external .exe files. I actually need something to access external .exe files from a desktop app/standalone flash. Does ExternalInterface still work in this case?
Copy link to clipboard
Copied
Also. I won't need to communicate between my app and external .exe. For now, I'd like to pull up .exe from my app.
Copy link to clipboard
Copied
I might be getting a bit ahead of myself. A flash projector cannot launch another executable "inside" itself. It can merely launch an executable, but then has no actual control or connection to it. This being the case, I was presuming you were already running Flash inside a more capable wrapper, like a visual c# or VB app that is displaying Flash via an ActiveX control (hence the link).
If you're not doing what I described above then ExternalInterface won't help. It (and fscommand) has the ability to communicate with a 'host' application. So if you did have, say, a visual basic wrapper running your Flash, ExternalInterface could communicate and receive events from it. The wrapper would also give you more control, such as the ability to run and to some extent manage an executed application in a few different ways.
Things get a touch more complicated and capable if you use AIR. You can use NativeProcess which monitors standard input/output, but your application would need to be built to utilize that. One immediate benefit of this is you can stop the executable whereas you cannot with fscommand(). That link will show you examples of STDIN/STDOUT communication as well as starting and stopping the process. However this process is not 'embedded' in Flash, it's separate. If that's acceptable functionality then it's worth a look. Using AIR functionality is almost as easy as adjusting your publish target to AIR for [platform of choice]. Do take note of the requirements of NativeProcess, such as extended desktop profile and using an AIR installer.
Copy link to clipboard
Copied
This thread (even if not marked as answered) has the answer:
Re: Launching external exe in AIR
The main thing to know is that the exe you can launch from your air-app must live inside(or beneath) the folder where the user installed your app.
So its not possible to run firefox/word etc. but only your own exe, which has to be installed in the same directory:
File.applicationDirectory.resolvePath("myApp.exe");
At some point you will want to communicate between the apps, trust me, even if it`s only to close all instances when you close your main program.
Don`t use the Native LocalConnection Class
Use this one instead: Projekt: asLocalConnect - The better way of LocalConnection for Flash

