dcsimg
A Flash Developer Resource Site

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

Thread: [RESOLVED] Can Flash Send Parameters to External Program?

  1. #1
    BullFrawg
    Guest

    resolved [RESOLVED] Can Flash Send Parameters to External Program?

    I've got a VB program I am planning to "sandwich" between two Flash projector files. The first Flash will run and then call the VB program. When the user exits the VB program, the second Flash will run. This way I get the functionality of VB for my application but the coolness of Flash for my Intro/Ending sequences!

    I've got this working just fine but I want to prevent the user from simply executing the VB program directly, thereby bypassing the Intro Flash.

    If I could get the Intro Flash projector file to send command line inputs to my VB program this would neatly solve the problem but I cannot figure out how to send these along with the FS Command's "exec" function.

    Any Ideas? (thanx in advance!)

  2. #2
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    If by command line inputs you mean..

    somexe.exe open
    somexe.exe /dothis

    Yes, flash can do this you simply use the exec command and then add the argument..

    I am currently working on debugging my program because my program is not interpruting the flash command (I believe that the fault lies in a standard command line .h file)

    Anyway, I was not aware that VB understood command line arguments.. (but then it's been a long while for me with VB)

  3. #3
    BullFrawg
    Guest

    Post

    Hmmm. Thanks but I already tried your suggestion and it does not seem to work. When I add the FS Command it takes two parameters, "exec" and the actual VB program name. If I try to add the VB command line parameter separated from the VB program name with a space or a slash or a comma, none of these work and the FS Command won't allow another parameter. I have created a shortcut on the desktop that correctly sends a command line parameter so I know the VB program is processing it correctly. Maybe I'm just missing something on the Flash to Windows to VB connection.

  4. #4
    Senior Member
    Join Date
    Jul 2000
    Posts
    266

    VB Command Line Arguments

    why not embed your intro and ending sequence into a form within your VB app' ?

    Simply use the SWF .ocx and away you go !

    I can't think of any reason - functional or asthetical that would require keeping the elements seperate.

    If this is not acceptable to you let me know - I'm very familiar with VB and Flash, and will try to help.

  5. #5
    BullFrawg
    Guest

    Post

    Your suggestion is a good one but it won't solve my problem on this project. You see, we will distribute the end product on floppy disks. However, the Visual Basic 6 executables don't appear to fit on a single floppy.

    Since our VB code was a) designed to be compatible with VB3 through VB6, b) does not use any VBX/OCX/ActiveX components and c) does not need long filenames, we plan to create the executables in VB3 and have plenty of room on the floppy for our Flash!

    Since I don't think there is a Flash VBX component or DLL compatible with VB3, I have assumed the best way (and smallest) is to use three separate executables, 1) Flash1.exe, 2) VB3prog.exe and 3) Flash2.exe. This is a fine solution except the end user could simply execute the VB program directly and avoid the Intro Flash.

    If there is no better solution around, I might just give the VB3 program an obscure name and set up the installer so it only produces an icon for the first Flash. That will probably handle 95% of the potential users of the package.

    If you have other advice I'd welcome it. Thanks in advance.

  6. #6
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Sorry about getting back to you so late.. but I was pretty embarrassed to learn that Flash 4 doesn't support command line arguments.. (I hate being wrong )

    I really don't understand it cause I must have tested the feature like 10 times.. and I thought I had 10 working responses.. This led me to believe my program had a bug.. I really don't understand how I missed such a crucial fact..

    Here's what I've learned since this crucial mistake..

    http://www.***********.com has a tool to launch executables with a command line interface (called JTOOLS)

    It uses special symbols on the command line interface that allow the executable to both be launched and then to read the data on the command line.. This allows the program to re-interpret the characters and send the correct sequence to the shellexecute API

    I haven't figured out exactly how JSTART reads the parameters from flash but when I do I should have my program completed shortly.. of course you are welcome to take a shot at it in VB or buy JTOOLS..

  7. #7
    Junior Member
    Join Date
    Mar 2000
    Posts
    11
    the trick is - you have to change spaces in fs exec command line to tab symbols (09 in hex).

    for example - FS Command ("exec", "program.exe /arg") will run only program.exe until you edit exported swf in hex editor and replace the space symbol (00 in hex) between '..am.exe' and '/arg' to horizontal tab (09 in hex).

    hth

  8. #8
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    While this helps.. it isn't the answer to my problem..

    You see.. unless jstart.exe modifies the flash executable on call the method you talk about isn't what there using.. (and I don't like the idea of having to write a .swf, .exe hex edit.. it's just too much work for the user)

    This just isn't a practicle solution to recreating JSTART's easy command line call.. Though I must say I value this information highly.. Thanks

    Status on my program:
    I've almost got the cdrom browse part done, shellexecute is already working but I have to add the parameter command line calls..

    Once cdrom browse is done.. I'm going to work on reading command line arguments through flash

    Note: It's not 00 it should be 20 in hex edit..
    [Edited by The Master on 07-26-2000 at 07:11 PM]

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Thanks to Gatha's post the answer is now YES
    http://www.flashkit.com/board/showth...?threadid=7819

    I had a hard time understanding exactly what the command is.. Just because I haven't hardly ever used the expression editor.. so it took me a few hours to get it.. but I'll try and simplify it for everyone..

    the command works like this..

    in the expression editor make the arguments a Expression
    then write it out like this
    "here is the name of the executable"& Chr (9) & "here goes the command line argument"

    The Chr (9) actually changes the hex of the code so when it writes the executable or .swf the HEX comes out at 09 (that's the one that works sort of as a space)

    Here's a picture to hopefully better demonstrate


    Note: the name of the program here is actually the one I'm working on to launch file types by default applications through the Shellexecute API

  10. #10
    Junior Member
    Join Date
    Aug 2000
    Posts
    3

    chr(9) vs. chr(32)

    Hello,

    not to step on toes but Chr(9) is a tab Chr(32) is a space. But I used Chr(9) with my code written in VC++ and it works fine. But now i'm writing the same program in VB and it chokes on the arguments passed to it. it executes but throws an error, because the second part of my expression FS_Command is not passed at all. Anyone have any ideas why it would work with C++ and not VB?

    Also both of my programs work just fine at the command-line.

    but the VB one chokes out of flash.

    ".exe" & Chr(32) & "c:\windows\notepad.exe"
    or
    ".exe" & Chr(9) & "c:\windows\notepad.exe"
    [Edited by secart on 08-08-2000 at 07:05 PM]

  11. #11
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Well the real question to ask is why would you want to write a VB application anyway?

    C and C++ is pure, (though M$'s is a little off) why sour it with the complications and lousy implementation of programming called Visual Basic??? (sure VB is easy.. but it still is a lousy Programming application) <-- Don't get me started on this cause I can rant and rave all day..

    I meant Character 9 was interpreted as a space in Flash not in Hex.. (I didn't bother to test the true space.. "if it works, leave it alone" is the old saying)

    I really truly can't understand why you would want to program in VB.. (but wouldn't it just be easier to launch a program through your C++ .exe) If you want to send me your VB code I can have a look, on that same note I can send you my C++ code if you would like to see it in action (though by your post I assume you already have the Shellexecute API working..) It's so easy isn't it..

    Ohh and in case you missed it I did launch 2 functional BETA's that open programs in there default applictions.. (these where both written in C++) http://www.flashkit.com/board/showth...threadid=13112
    And one of these days I'll optimize them and add a Cdrom browse command and release a final..
    [Edited by The Master on 08-09-2000 at 01:42 AM]

  12. #12
    Junior Member
    Join Date
    Aug 2000
    Posts
    3

    Post VB and C++

    Hello,

    Your correct VB is easy, and I picked a lot up on it in about one day. I went with it beacuse I cut the size down of my application with VB. Also VB has auto parsing of the command line or command spliter function. But i'm not here to stand for one or the other I enjoy both VB and C++

    I was just wondering why both would work just fine at the command-line and the VB program would choke with flash sending it the arguments. It should work the same as the c++ program, but it doesn't.

    Thanks anyway.



  13. #13
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    What you want is Delphi not VB, Delphi executable start at around 20 to 30 kb if it's Console (that's command line arguments) if you make a visual application then executables start out at around 150 kb (these programs have 0 dependencies)

    It always good to work with a programming language that has a future.. and soon Delphi will be compatible with 2 OS's as a Linux version is in development

    To me Delphi is everything VB should have been..

    Anyway back to practically.. I tested 2 command line applications I found on planet-source-code (one of the better things about VB however is the amount of shared knowledge) and both came up negative when executing parameters from flash just as you said.. Now I could spend hours and hours of debugging, testing and surfing to see if VB has some tiny little option that would fix this.. But that's your job

    My summary of why it doesn't work.
    VB = Flawed programming language

  14. #14
    Junior Member
    Join Date
    Aug 2000
    Posts
    3

    Post

    My VB app is less then 20 kb. and for Delphi I don't think so. But yes your right its my job to look and search for the answer which is what i'm doing. I thought i would ask here first since its flash that i need to understand how it passes arguments.

    Thanks again.


  15. #15
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Your best bet at saving time on such a quest would be to download a very, very proffesional VB app (probally made by a team of programmers) one that of course executes command line arguments.. And then just test to see if it can be done..

    I would look for a App like that at http://www.downloads.com or http://www.zdnet.com/downloads

    You also might be able to understand more about how Flash works with command line arguments by looking at the source code of the flash player from http://www.macromedia.com if I remember right it was specifically made for VC++ so you should have an easy time looking at it..

    One last thing you do know that even when a VB app compiles to say 20 kb (I've had mine at 10 kb )

    That if you are to do a proper distrubution guarenteed of working on all computers you will need to include 1 to 3 Mb's of runtime .dll's?

  16. #16
    Senior Moderator
    Defender of the Faith
    Pope de Flash's Avatar
    Join Date
    Feb 2000
    Posts
    3,429
    Here you go boys and girls, a little toy for you to play with

    http://www.ashzfall.com/products/afsaver


    Regards, Bill

  17. #17
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Took long enough to find that program..

    There does appear to be two small problems from a quick glance though..

    A. It doesn't install on 2000
    B. It's kind of big don't you think?
    [Edited by The Master on 08-09-2000 at 11:39 PM]

  18. #18
    Senior Moderator
    Defender of the Faith
    Pope de Flash's Avatar
    Join Date
    Feb 2000
    Posts
    3,429
    Its big but it is the only solution right now. I know about the win2000 thing but the NT solution should run on 2000. I dont know how far this guy has this thing. I have emailed him four times to do a reivew and he or she never ever answers. Its like they are selling it but with no support. Oh well. Regards, Bill

  19. #19
    BullFrawg
    Guest

    Use Whatever Tool Does the Job

    Originally posted by The Master
    Well the real question to ask is why would you want to write a VB application anyway?

    C and C++ is pure, (though M$'s is a little off) why sour it with the complications and lousy implementation of programming called Visual Basic???

    I really truly can't understand why you would want to program in VB.. (but wouldn't it just be easier to launch a program through your C++ .exe)
    [Edited by The Master on 08-09-2000 at 01:42 AM]
    OK. We get it that you don't like VB.

    C, C++, VB, Flash; they are all just tools, not religions! I personally could care less about the tool or its "purity"!! If it does the job I'm happy!

  20. #20
    Senior Member
    Join Date
    Jun 2000
    Posts
    666
    Given the fact that the last Beta was in March of 2000 that isn't suprising.. still it costs money so that's a plus for my App

    Still all the the things the app claims to do are really actually easy to implament.. and I'm not sure if the executable I could make would come out at 300 + kb that seems kind of big.. (of course he is using a Visual interface.. or so it appears and that does add size)

    OK. We get it that you don't like VB.

    C, C++, VB, Flash; they are all just tools, not religions! I personally could care less about the tool or its "purity"!! If it does the job I'm happy!
    Yah but you don't get it.. it doesn't do the job.. In the end it causes more problems then solutions

    Isn't there enough bad programs out there already?

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