A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: External exe.

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    11

    External exe.

    I am new here as well newbie for flash .. I have installed Macromedia Flash 8 on my system .. I need help is there a way to load an external exe. from application path into the frame ... or is there a way to call an external exe. from movie or button from application path .. help will appreciated .. thanks

  2. #2
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    You can execute an exe file or a .bat file but you can not load an exe file inside flash.
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  3. #3
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Will you please help me with the code and procedure to execute the same.. thanks in advance

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Make a folder called "fscommand", put the exe files you wish to call from the main exe inside the folder,

    You can call the exe files from main like so
    PHP Code:
    myButton.onRelease = function()
    {
        
    fscommand("exec""callme.exe");
    }; 
    you can also call other swf files into the main exe file like so
    PHP Code:
    myButton.onRelease = function()
    {
        
    loadMovie("callme.swf",1);
    }; 
    it would be the same with the batch file,
    PHP Code:
    myButton.onRelease = function()
    {
        
    fscommand("exec","callme.bat");
    }; 
    and the simple batch file could contain something like so
    Code:
    start "c:\windows\system32" notepad.exe
    if you are using windows then it would launch notepad.

    But you can not load an exe file into an exe file

    Adobe info:
    The exec command can contain only the characters A-Z, a-z, 0-9, period ()., and underscore (_). The exec command runs in the subdirectory fscommand only. In other words, if you use the fscommand exec command to call an application, the application must reside in a subdirectory named fscommand.

    you might wish to check out one of the guys who posts here website, which is dedicated to projector files amongst other things http://www.northcode.com/

  5. #5
    Designer, Programmer, Musician angelhdz's Avatar
    Join Date
    Mar 2010
    Posts
    971
    Then they said i'm the one who are seeking for applauses or keeping track of my posts and trying to get the higher amount of posts in this forum hahaha. He said "into the frame", so he was asking if he can import an .exe inside of flash, i replied that is not possible, and you , like always, had to have the last word, as if you were a king or a higher or important person here or something. Pffftttttt -_- Boaster. I don't want to argue, but i don't like when people gets jealous and start a stupid competition. You are always commeting in all the posts I reply to, knowing that I already replied, like if you were saying "hello everyone, i arrived, all these posted scripts are a trash, these are noobs, i am a professional, and i'm here to show people my high knowledges".
    I tried to make peaces here but you don't leave me other options. I wish this forum had a "Block user" option.

    I've seen posts with really huge issues and questions, and you never comment these posts, but posts where I have knowledge, because i'm a noob, according to you, then you came out to boast. This is like an advanced player playing entering a beginner level room in a game, and boasting and critizing the efforts of an intermediate player to help the less experienced ones. You forget that you were a noob once in your life. So it would be fair, that if you see that someone is already helping anyone here, you can explain why his/her script is wrong and yours is PERFECT, don't just ignoring their posts and commenting as if you were some eminence here.

    Have a nice day Mr. Nothing-Cares
    Already mastering AS3. It was so fun. Now into Javascript and PHP and all its libraries

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Perhaps you should stick to answering questions Angel, like you, I will answer questions I see fit to answer, sometimes I am unable to answer so I keep quite and do not just give random answers that have nothing to do with the question.

    quote: "or is there a way to call an external exe. from movie or button";
    quote: "Will you please help me with the code and procedure to execute the same.. thanks in advance";

    I don't need to explain myself to you sir.

    i do in fact notice you doing the same to questions I answer, do I complain to you that you join in, NO.

    You certainly give us praise when we help YOU though.

    Get over your problems and yourself.

    Enjoy your day. xx

    P.S sorry to fill up your thread with this dribble
    Last edited by fruitbeard; 02-27-2014 at 08:43 AM.

  7. #7
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Quote Originally Posted by fruitbeard View Post
    Hi,

    Make a folder called "fscommand", put the exe files you wish to call from the main exe inside the folder,

    You can call the exe files from main like so
    PHP Code:
    myButton.onRelease = function()
    {
        
    fscommand("exec""callme.exe");
    }; 
    you can also call other swf files into the main exe file like so
    PHP Code:
    myButton.onRelease = function()
    {
        
    loadMovie("callme.swf",1);
    }; 
    it would be the same with the batch file,
    PHP Code:
    myButton.onRelease = function()
    {
        
    fscommand("exec","callme.bat");
    }; 
    and the simple batch file could contain something like so
    Code:
    start "c:\windows\system32" notepad.exe
    if you are using windows then it would launch notepad.

    But you can not load an exe file into an exe file

    Adobe info:
    The exec command can contain only the characters A-Z, a-z, 0-9, period ()., and underscore (_). The exec command runs in the subdirectory fscommand only. In other words, if you use the fscommand exec command to call an application, the application must reside in a subdirectory named fscommand.

    you might wish to check out one of the guys who posts here website, which is dedicated to projector files amongst other things http://www.northcode.com/
    I get the error while playing it
    PHP Code:
    **Error** Scene=Scene 1layer=Layer 1frame=1:Line 1Statement must appear within on handler
         myButton
    .onRelease = function()

    Total ActionScript Errors1      Reported Errors

  8. #8
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I believe you are probably placing the code inside of the button, place the code on the main timeline instead, remove from the button.

    or use it on the button if you want or need to like so, on (release) { fscommand("exec", "callme.exe"); }

  9. #9
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Quote Originally Posted by fruitbeard View Post
    Hi,

    I believe you are probably placing the code inside of the button, place the code on the main timeline instead, remove from the button.

    or use it on the button if you want or need to like so, on (release) { fscommand("exec", "callme.exe"); }
    no working .. it will be better if you provide a sample please

  10. #10
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    It's a shame you can not get it to work (all the code you need is here, perhaps your are not changing the names to your names!!), it will be better if you attach your *.fla file or make a link for us to download it.
    It makes it easier for us to see your layout and not have to try and recreate your set up.

    Perhaps even describe the folder structure.

    I use CS6, so I wouldn't be able to create an example for you to be able to open in Flash8, unless you use CS6 as well.
    Last edited by fruitbeard; 02-28-2014 at 12:50 PM.

  11. #11
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    here i am attaching a sample with two examples one with coded in time line and another within the button
    Attached Files Attached Files

  12. #12
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    The pink button needs to be given an instance name (properties) in this case 'myButton' and the associated code will be placed on the timeline like so
    PHP Code:
    myButton.onRelease = function()
    {
        
    fscommand("exec""test1.exe");
    }; 
    The black button needs this code placed actually on the button itself, no instance name is necessary, this code
    PHP Code:
    on (release) {
        
    fscommand("exec""test1.exe");

    and most importantly, you need to publish the projector file (exe) as fscommand only works with exe files.

    file -> publish settings -> check win projector - then publish and save

  13. #13
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    thanks, it worked .. if i am not wrong .. as per your experience is there any soft. which can load external exe. within the application

  14. #14
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    Well done.

    Do you mean load exe file into flash software itself or load exe file into another exe file created by flash?

    Why would you want to load an exe into flash itself?

    What is your goal?

    Zinc springs to mind

  15. #15
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    load exe file into another exe file created by flash .. I have another question also ... How can we set the application path to an exe. instead of folder fscommand

    PHP Code:
    on (release) {
        
    fscommand("exec""test1.exe");


  16. #16
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    The requirement to have a folder called "fscommand" that contains all your EXE files is a security feature. It's not for your benefit, it's for your users. Anyone can look in the fscommand folder to see what's there and decide whether they want to trust your app or not.

    If you want to execute a file that's outside the fscommand folder you can do it, but it has to be started by something in the fscommand folder i.e. another EXE or a BAT file (if you can't make your own EXE files).

    I have a free tool called Proxy that will let you launch BAT files like EXE files without the ugly DOS box. The blog post I linked to has more information.

    I also make a commercial swf2exe tool called SWF Studio that will let you APPEAR load an EXE into your Flash application, what it really does is force the EXE to be a child window of your Flash EXE. You can't communicate with the child application or get information from it.

    Some applications don't like being forced to become the child of another app but it can work as long as you understand the limitations, and test like crazy. The EXE really isn't "IN" your EXE but it will become a child window and will move with your window. Things like resizing and going fullscreen will break the illusion.
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  17. #17
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Thanks, I know what I am going to ask is out of contest .. I need to know that how can I create cmd exe. like

  18. #18
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Not quite sure what you're asking for?
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

  19. #19
    Junior Member
    Join Date
    Feb 2014
    Posts
    11
    Quote Originally Posted by Northcode View Post
    Not quite sure what you're asking for?
    like the one you have created c:\ test.exe

    I have another question in mind .. how can i embed youtube video url in flash 8 .. when application is launched if internet connection is available .. youtube video will play else it will generate an error [ with out net connection]

  20. #20
    Lifetime Friend of Site Staff Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    The test.exe in that example is just a renamed copy of proxy.exe. It's renamed so it matches the BAT file, which is where the real work is done. If you read my blog post about the proxy tool it should be pretty clear. You'll need one renamed copy of proxy.exe for every BAT file you want to execute.

    I have another question in mind .. how can i embed youtube video url in flash 8 .. when application is launched if internet connection is available .. youtube video will play else it will generate an error [ with out net connection]
    When the youtube video plays, do you want it to open a browser or play inside your Flash movie?
    When your swf2exe tool just HAS to work
    there's only one choice... SWF Studio

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