+ Reply to Thread
Results 1 to 5 of 5

Thread: Interactive CD. Default CD-ROM link

  1. #1
    VIP Member calvin&hobbs's Avatar
    Join Date
    2005 Oct
    Location
    Ethernetville, eth0
    Posts
    1,673

    Default Interactive CD. Default CD-ROM link

    I am busy creating a interactive multimedia cd rom. I am working in flash and I want to create a button to go to files on the cd rom. Obviously the CD ROM letter will change every time. What do I have to do so that the files can be accesed when the button in my flash presentation is clicked.

    I hope this question is in the write section.

    Thanks
    Intel Dragon Tail | Core2 Duo E6750 | 4096 mb DDR800 Corsair Gaming Memory | 3 terabyte HDD's | XFX HD4870 512 MB DDR5 | Coolermaster 500W Extreme Power | Coolermaster CM 690 Case | LG 24" Screen | Razer Death Adder | Razer Lycosa mirror addition.

    Nic: Kat$wink (look me up on COD4 and CODMW2)

    Website

    John Junor
    An ounce of emotion is equal to a ton of facts.

  2. #2
    PCBG Moderator ruach's Avatar
    Join Date
    2005 Jan
    Location
    /\/ŻŻŻŻŻ\/\
    Posts
    4,110

    Default Re: Interactive cd. Default cd rom link

    Quote Originally Posted by calvin&hobbs View Post
    I hope this question is in the write section.

    Thanks
    heheh yep right section

    can you not just call it like "../folder/"

    something like that?

  3. #3
    Administrator Maximus's Avatar
    Join Date
    2004 Aug
    Location
    Cape Town
    Posts
    4,582

    Default Re: Interactive cd. Default cd rom link

    Buddha is on the right track. Try using something like .\folder\ or ./folder/, you can also try it without the dot, i.e. \folder\ or /folder/
    FIFA - Fascism disguised as a football federation. FICK FUFA!

  4. #4
    VIP Member calvin&hobbs's Avatar
    Join Date
    2005 Oct
    Location
    Ethernetville, eth0
    Posts
    1,673

    Icon12 Re: Interactive cd. Default cd rom link

    RIGHT!!!!


    I have figured it out! I did some Googling and this is how I got it to work:

    For the Exploring of the cd I did this:

    For the .bat file to find the CD drive letter you could use:

    for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%a:\CD.txt set CDROM=%%a:

    This will search all the drive letters for the file CD.txt, so just create a blank text file and name it CD.txt, when the batch file finds the file CD.txt it sets the variable %CDROM% to that drive letter. Now, anywhere you want to use the drive letter in this .bat file just put %CDROM%

    then continue the batch file as normal and you could use this to open the CD Drive

    "%systemroot%\explorer.exe" %CDROM%\

    by using the %systemroot% variable also if any user has windows installed to any different directory it will be loaded from the correct place, so the explorer will never fail to load.

    So, try creating a blank CD.txt file on the root of your CD, then link the "browse CD" button to a batch file containing:

    for %%a in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%a:\CD.txt set CDROM=%%a:

    %systemroot%\explorer.exe %CDROM%\
    LINK

    And for the buttons that I want to click to individual files to I did this:

    A typical requirement you'll run across when developing CD based Flash projects is the need to open documents from your Flash projector. You can use getURL to open most documents, but sometimes the document opens behind the projector. The EXEC fscommand could be used to launch a helper application, but unfortunately the EXEC fscommand doesn't allow you to pass parameters to external applications so you have no way to tell the outside world which file you want to open.

    You can thank the creators of the first Flash virus (SWF/LFM-926) for the fact that every version of the stand-alone Flash player since Flash MX has restricted the use of the EXEC command. This change made it impossible for anyone to create any new Flash based viruses, but it also crippled the Flash projector as a tool for legitimate users by instantly rendering many free projector extension tools useless.

    There are four key restrictions that you have to keep in mind when working with the EXEC fscommand and standalone Flash projectors. (i) Executables you want to run via the EXEC fscommand have to be in a special sandboxed folder called fscommand in the same directory as the projector. (ii) You can't specify a path in the EXEC command, just a filename. If the specified file is not found in the fscommand folder, it won't run. (iii) The only argument allowed by the EXEC fscommand is a filename, there is no way to pass arguments to the executables that you want to run. (iv) You can't use EXEC from an SWF file, it will only work from a projector (EXE). The last restriction doesn't really concern us, but if you're trying to test your EXEC calls, being aware of it will save you some frustration.

    Update One additional restriction you will have to deal with is the fact that Flash 9 projectors can't launch BAT files on Windows 2000, XP and Vista.

    Important If you use SWF Studio then you don't need to read any further. SWF Studio still supports the Flash EXEC FSCommand but the limitations have been removed. Your SWF Studio projectors will be able to pass arguments to external applications and you won't have to put the executables you want to run in the fscommand sandbox folder. SWF Studio extends Flash with new commands like ssCore.Shell.execute and ssCore.Shell.open that make the EXEC fscommand obsolete and give you an unprecedented amount of control over your external applications and documents.

    One solution to get around the limitations of the EXEC fscommand is to create one exectuable file for each file that you want to open, but what can you do if you don't know how to make EXE files? Windows and Flash both consider a BAT file as an executable file so the easy solution is to create a BAT file for each file you want to open and EXEC the BAT file from Flash. You don't need to be a BAT file wizard to do this, the simple one-liner below (let's call it mydoc.bat) will do the trick:

    start mydoc.pdf


    That example assumes that both mydoc.bat and mydoc.pdf are in the fscommand folder. You can change the BAT file to launch the PDF file from anywhere you like, as long as you can create a valid path to the file. Now all you have to do is create a BAT file for every file you want to open and call it from Flash like this:

    fscommand("exec", "mydoc.bat");


    The only problem with this approach is that your user is going to see the ugly black DOS box appear every time they open a file. That's where the proxy utility can help you create a more professional looking end product for your users. Proxy is able to launch BAT files and suppress the ugly DOS box.

    usage: proxy.exe

    When you run the proxy utility, the first thing it does is look at its own name, in this case proxy.exe. It then looks for a BAT file in the same directory with the same base name, i.e. proxy.bat, and runs that BAT file. If you rename the proxy utility to xyz.exe then the utility will look for and try to run xyz.bat. If a BAT file with the same name can't be found, proxy will just fail silently.

    By making copies of proxy.exe with different names and creating multiple BAT files you can run as many "hidden" BAT files as you need, neatly sidestepping the Flash limitation on passing parameters to external applications.

    Here are step by step instructions to use the proxy utility to open a PDF file without the ugly DOS box.

    Create a BAT file called file1.bat that contains just the following line. This is a plain text file that you can create with notepad or your favorite text editor.

    start file1.pdf


    Put the BAT file in a folder called fscommand along with a copy of proxy.exe.

    Rename the copy of proxy.exe to file1.exe (same base name as the BAT file you created).

    Place your PDF document (called file1.pdf) in the fscommand folder with the BAT and EXE files. You don't have to store the files you want to open in the fscommand folder, but for your first test this makes things easier.

    Add the following command to your FLA where you want to open the PDF document (probably on a button release action).

    fscommand("exec", "file1.exe");


    Now put your Flash EXE and the fscommand folder on your desktop and run the Flash EXE. When the EXEC command is called your PDF document should open.

    The example.zip contains the source for a simple Flash MX projector (projector.fla), a compiled version of the projector (projector.exe) and an fscommand folder with a copy of the proxy utility (renamed to test.exe), the BAT file that the proxy utility will launch (test.bat) and a PDF file (test.pdf) that will be opened when the BAT file is run. Download the example to see the proxy utility in action.



    Version: 3.0
    Released: August 13, 2007
    Download: proxy.exe (52KB)

    This utility has been around for many years now and the Standalone and Applications forum that I moderate at FlashKit is home to a few long running discussions about problems other people have encountered and how the proxy utility has helped them. Definitely worth a read.
    LINK

    There it is for someone else if they struggle!
    Intel Dragon Tail | Core2 Duo E6750 | 4096 mb DDR800 Corsair Gaming Memory | 3 terabyte HDD's | XFX HD4870 512 MB DDR5 | Coolermaster 500W Extreme Power | Coolermaster CM 690 Case | LG 24" Screen | Razer Death Adder | Razer Lycosa mirror addition.

    Nic: Kat$wink (look me up on COD4 and CODMW2)

    Website

    John Junor
    An ounce of emotion is equal to a ton of facts.

  5. #5
    PCBG Moderator RockSpider's Avatar
    Join Date
    2004 Aug
    Location
    Edenvale
    Posts
    7,278

    Default Re: Interactive cd. Default cd rom link

    As easy as that ! LOL ! :blink:
    The old saying : Seek and ye shall find seems to have stood the test of time.

    Nice one C&H.
    'I don't want to believe, I want to know.' -Carl Sagan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Posting Permissions

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