Open Programs From Flash?!! 
Posted: 29 July 2008 07:36 PM   [ Ignore ]
New Member
Avatar
Rank
Total Posts:  51
Joined  2008-07-01

Hello,

I was looking around and i could not find out how this would be done. ( or if it could even be done). I was wondering how i could create a button that could open a non flash file from a flash app.Such as programs that are installed on the hard drive (for example:Firefox;Any internet browser) I was trying to figure out how to open notepad.exe and i couldnt figure out how to do this. I looked into the fscommand and i am really not sure if that is able to load exe files that are not projector files. I was wondering if anyone has a way of opening non flash programs from a flash app?

 Signature 

“Good ideas are only bad ideas that work!”

Profile
 
 
Posted: 29 July 2008 07:42 PM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  622
Joined  2008-02-12

I’m not to sure about flash but i know adobe AIR can allow you to do that

 Signature 

My MultiTouch Blog
My Youtube

Profile
 
 
Posted: 29 July 2008 07:49 PM   [ Ignore ]   [ # 2 ]
New Member
Avatar
Rank
Total Posts:  51
Joined  2008-07-01

I am not sure exactly how to use air… Is it an extension for flashCS3 or is it a completely new software. I am pretty sure that i know what it does though… (I think it is a runtime that allows for desktop apps that run mainly off of flash based components...I havent searched to see exactly what it is...) could you explain how i would be able to use air since i need to be able to load other programs from my flash… Thank you??/smile/??

 Signature 

“Good ideas are only bad ideas that work!”

Profile
 
 
Posted: 30 July 2008 12:27 AM   [ Ignore ]   [ # 3 ]
New Member
Avatar
Rank
Total Posts:  57
Joined  2007-12-08

This is extremely difficult in Adobe Air.  Seems like Adobe is working hard to keep Flash in a secure little sandbox. Currently the file formats that are available are other Air files and pdf.  Here is a link to a proof of concept from Mike Chambers of Adobe. 

http://www.mikechambers.com/blog/2008/01/17/commandproxy-net-air-integration-proof-of-concept/

Profile
 
 
Posted: 30 July 2008 11:42 AM   [ Ignore ]   [ # 4 ]
New Member
Avatar
Rank
Total Posts:  51
Joined  2008-07-01

Thank you I am pretty sure that i have figured this out. I am going to test my app later when i get a chance. I have figured out how to run AIR in flash. If u are talking about connecting to the FLOSC server i am pretty sure that this works the same with an air app. Is there somethin on the wiki or somewere on the forums that explain how to use AIR with multitouch apps. I am going to test out the new runtime with my apps a little later. I will post later if I find something on how to use AIR with multitouch. I am going to also post and let you know how it is going thanks for the page link. I am going to look at the page. I am just not sure what it is that you are refering to.

 Signature 

“Good ideas are only bad ideas that work!”

Profile
 
 
Posted: 30 July 2008 12:42 PM   [ Ignore ]   [ # 5 ]
New Member
Avatar
Rank
Total Posts:  33
Joined  2008-05-26

on win
make a button
btn.onPress = function () {
fscommand("exec", “openFile.bat");
}
make a bat : openFile.bat
start nameOfTheFile.exe
exit
on Mac the same stuff with a .shell or a .command

Profile
 
 
Posted: 30 July 2008 08:52 PM   [ Ignore ]   [ # 6 ]
New Member
Avatar
Rank
Total Posts:  51
Joined  2008-07-01

Thanks,

I have been seeing this around on flash forums everywhere, but i am not sure how but it is not working for me. I am not sure if it is the way that i am coding things or if its just that i have some security settings wrong. I was wondering if you could post a sample project. Or maybe a video showing it working including an explanation. - it may be simpler just to post a sample code. Thanks again for helping me on that solution. That is what i have been testing for the past few days. I think that it is just something in my flash code that is keeping it from executing the batch file that i have made.

 Signature 

“Good ideas are only bad ideas that work!”

Profile
 
 
Posted: 30 July 2008 11:13 PM   [ Ignore ]   [ # 7 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  622
Joined  2008-02-12

This will be more helpful for you, this looks like its AS2 but it may work for AS3 im not sure

The exec command is used to launch an external application.

* In Macromedia Flash MX the external application must be in a subfolder named ‘fscommand’. This subfolder must be in the same directory as the projector which uses the fscommand action. This security restriction helps prevent malicious use of the exec option.

The following script launches the Windows applicationsomeApplication.exe, which is in the fscommand folder on the same level as the projector:

on (release{
        fscommand 
("exec""someApplication.exe");
      
}

Note: The fscommand subfolder path is not used in the argument. Place someApplication.exe inside the fscommand folder, but just use the name of the application in the argument.
* In Macromedia Flash 5 the argument to exec must be the absolute or relative path to the application to launch. If no path is specified, Macromedia Flash assumes the same folder in which the projector resides. The following script launches the Windows application someApplication.exe, which is in the same folder as the projector:

on (release{
        fscommand 
("exec""someApplication.exe");
      
}

Although it is possible to use absolute or relative paths to open applications in folders other than the one in which the projector resides, problems have been reported with deeply-nested directory trees or folders higher in the tree than the projector itself. Therefore, it is preferable to keep the executables in the same folder, or a folder directly beneath it.

When specifying paths, a single dot represents the folder (equivalent to the example above ) in which the projector resides:

// points to a folder beneath the one the projector is in:
      fscommand ("exec""./foldername/someApplication.exe");

Two dots refer to the parent directory of the folder in which the projector resides:

// points to a folder in the the parent of the projector:
      fscommand ("exec""../foldername/someApplication.exe");

Preceding the path with a slash refers to the root folder of the disk the projector is on (absolute path).

// assuming the disk is D, points to D:/foldername
      fscommand ("exec""/foldername/someApplication.exe");

Use forward or backward slashes to separate folder names in Windows projectors; use colons in Macintosh projectors. For more information see How to specify folder paths in Macintosh projectors (TechNote 15942).

Note:exec is not capable of opening a specific file with an application, just the application itself. One way to open files is to use exec to launch a Windows batch (BAT) file or Macintosh AppleScript file that then opens files in the desired application. A third-party tool that can open specific files on Windows without using batch files is available from Flashjester.

So from what i gather say if you want to use this command you have to have the exact location of the file…

 Signature 

My MultiTouch Blog
My Youtube

Profile
 
 
Posted: 09 August 2008 12:15 AM   [ Ignore ]   [ # 8 ]
New Member
Avatar
Rank
Total Posts:  51
Joined  2008-07-01

With the AIR update that i downloaded there is a way… but i cant seem to get it to work… I did figure out how to load swf files to the stage though.  Almost like the appLoader in the svn, i don’t think that i did it the same way… the way that i found is much simpler.This can be done in Flash9 also because Flash9 and AIR both use AS3 as default. I found this on the oman3d site.

Is this the same way that the appLoader works?

If anyone working with AIR could help as to how to load applications such as Firefox.exe it would be greatly appreciated.

 Signature 

“Good ideas are only bad ideas that work!”

Profile