Link to home
Start Free TrialLog in
Avatar of amedio
amedio

asked on

fscommand in .as with arguments

Hi there....

So here is the deal. I am working with a projector in flash 8, the .exe file. Resides in folder "myproject".
I also have a GO.BAT file under myproject\fscommand with this code:
@echo
c:\i_viewer.exe %1
This exe file is Irfant Viewer. Just a simple viewer to see images. The %1 is the argument of the file I want to see.

Under myproject/images there are lots of images.

I also have a button that runs this actionscript within flash
var filename:String=.........
fscommand("Exec", "GO" add MbChr(9) add filename)

I have also tried "Go.bat " + filename //  "Go.bat_20" + filename..etc etc

nothing seems to work, unless the command is fscommand("Exec","Go.bat"). anything different that this, just does not do anything.

One more thing. The function that calls the button in under myproject/code/source/Functions.As and it is imported to the main fla file.

Any hints?
ASKER CERTIFIED SOLUTION
Avatar of CyanBlue
CyanBlue
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of amedio
amedio

ASKER

How is that possible?

In http://www.flashjester.com the tool JSTART uses

fscommand("Exec", "JSTART params....."). See the examples.

100% Sure about that?.
That's working because you are using JStart...  That line won't work if you are using Flash only...

That happens because of the security setting that Macromedia has put to block any hacking attempt...

CyanBlue
Avatar of amedio

ASKER

Ok so when Jester´s Jugglor uses fscommand to open a file with parameters, it actually modifies/recreate the EXE file created by flash?

Let me show (Jugglor uses this script in flash, and ):

on (release) {
      fscommand("Exec", "JSTART_20local_25PresentationCD_5Cpptview.exe_20_2FL_20_22playlist2.txt_22_20_2Fdir_3Dlocal_25PresentationCD");
}

Wich seems to me like JSTART %local\PresentationCD\pptview.exe /FL playlist2.txt /Fdir %local\PresentationCD
Where I am pretty sure _20 is space and so on.

What is your recomendation to do this Jugglor? Zinc? mProjector?...they are all around 300$ and I don´t want to waste money if is not going to do teh trick.

Thanks again Cyan.

Well...  All the third party projector tools comes with the trial version you can play with...  You've got to get your hands dirty and find the one you like...  and each tools have its own advantage, so you have to choose what you like that suits your need...
I personally use Zinc but I used mProjector for my projects at work...

Don't forget to check out the Screenweaver which is open source project...

CyanBlue
Avatar of amedio

ASKER

Just for the record...if anyone has the same problem as I did.

CyanBlue was 100% right. in Flash Mx and Flash 8 nothing like " " or char(9) or any combination rather than a plain file (exe, bat...) will not work in fscommand.

I tried Jugglor and Jstart to work around the problem. But it did not work all the time. Parameters were a pain in the neck and the interface and docs (the way I see it) where not quite clear.
I also tried mProjector that inlcudes the mfile library. The wierd solution I found was to write a .bat file each time I needed with the aplication and parameters in the .bat file. Then call this .bat with a plain fscommand.
I used the mfile.WriteString from mProjector to write the .bat file every time with the parameters I needed.

I am sure it´s not the cleanest solution....but it did work for me.

Thanks Cyan!.
Hm...  It's been a long time, but I did have a project that calls an external EXE file with a parameter with mProjector...  Not that I can remember what I did, but it did work...
At any rate, I'm glad to hear that you've found the solution that works for you...  :)

CyanBlue