A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Launching an .exe file from a flah projector.

  1. #1
    Member
    Join Date
    Jan 2001
    Posts
    18

    Launching an .exe file from a flah projector.

    Can anybody help me find out how to launch an .exe file from MX.
    The fsCommand does not work for me in MX but only in Flash 5.
    I also need to know how to launch a .mov Quicktime file from a projector.
    Please Help
    Thanks

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    on(release){
    fscommand("exec","qtmovie.bat");
    }

    Create a subfolder in the same folder that holds your projector, named "fscommand".

    In this "fscommand" subfolder, create a batch.file with Notepad.
    A batch file is simply a text file with a .bat extension.
    So "qtmovie.bat" would hold:

    @ echo off
    start sample.mov
    exit

    That's it. Test your projector file.

    This will work assuming your .mov file type is associated with the QT player on your machine.

  3. #3
    Member
    Join Date
    Jan 2001
    Posts
    18
    Does this work on a MAC

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I doubt it very much... Those Macs are so sensitive!

    exec


    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 application someApplication.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 ***********.

    Works fine on PC, but I know nothing about AppleScript files!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center