A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: dynamic fscommand

  1. #1
    Senior Member
    Join Date
    Jul 2000

    dynamic fscommand

    Hi there,

    I have a standalone projector pulling in data from an XML doc. Basically the XML contains about 40 PDF file names and I was pushing the data as HTML into a textfiled with scrollbar. Well the links go to a PDF and works on a lot of PCs I tested on, but not all.

    so in my XML doc I have

    <link1>CDATA stuff
    <a href="somepdf1.pdf" target="_blank>PDF name 1</a><br>
    <a href="somepdf2.pdf" target="_blank>PDF name 2</a><br>

    But is there a way to push fscommands in? I don't want to hardcode them to buttons, I want to have the text in XML doc be clickable and launch fscommands. Is this possible?

    I am working in Flash MX and I have read that fscommands work by putting PDFs in a folder called "fscommand." Is this correct and is the code"

    fscommand("EXEC", "somepdf1.pdf");

    How to I make that dynamic in XML?


  2. #2
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Whitehorse YT
    fscommand("EXEC", "somepdf1.pdf") will NOT work unless you're using a third party tool that supports that extension of the exec command. In Flash, the EXEC command only works with executable files like .BAT, .COM and .EXE files and since Flash MX they have to be in a special folder calls fscommand. You can read more about this at http://www.beyondflash.com/content/ch05.htm.

    FSCommand is just like any other Flash function that takes a string as an argument. You don't have to use string literals, you can use variables as well (see example below). So if you can pull the file name out of your XML you're halfway to a solution...

    cmd = "exec";
    file = "something.exe";
    fscommand(cmd, file);

    Any one of the following commercial tools will provide a way to open PDF and other external files. Each solution is slightly different. For example, in SWF Studio you would say fscommand("ShellOpen", "somepdf1.pdf") and in FlashStudio PRO you would say something like fscommand("flashstudio.exec", "somepdf1.pdf").

    SWF Studio http://www.northcode.com
    Flash Studio http://www.multidmedia.com
    Jugglor http://www.***********.com
    FlashAnts http://www.flashants.com
    Flash 'N Pack http://www.flashnpack.com
    SWFKit http://www.swfkit.com
    LPFlashEX http://www.logicplus.com.hk

    In addition, you can use PROXY.EXE to do this. This is a tool I wrote that will let you run BAT files from Flash and avoid the ugly DOS box. This way you just create one BAT file for each PDF file you want to open and call the BAT file instead of the PDF file.

    The best part? It's absolutely FREE. You can download the utility from www.northcode.com/misc/proxy.zip. There's minimal documentation in the ZIP file, but there was a big disussion about it (and some other utilities I wrote) in this thread...


  3. #3
    Senior Member
    Join Date
    Oct 2000
    Hannover, Germany
    HI Northcode, I have a extended question to the question...I've been trying for weeks to get this to work- almost the same situation...but I need to pull the names out of an xml document and then load them into a listbox component. Upon clicking the names in the list box, the pdfs should open...I'm really struggling here- any help???



  4. #4
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Hi, download a copy of Flash Studio PRO v2 and you can execute the files loaded into your listbox using a simple flashstudio.exec command

    If you have a look at the examples available at http://www.multidmedia.com/software/...udio/downloads and also at http://www.multidmedia.com/exchange I'm sure you'll find a useful example similar to your needs.

    Alternatively, you can also find help and resources at http://www.mdmforum.com

    I hope this helps

  5. #5
    Senior Member
    Join Date
    Oct 2000
    Hannover, Germany
    Thanks Gambini, I'll check out the links!

  6. #6
    To be more specific with Jugglor please look at this and download the example file


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