dcsimg
A Flash Developer Resource Site

Page 1 of 4 1234 LastLast
Results 1 to 20 of 65

Thread: Need Help, Will Pay... CD Presentation using PDFs

Hybrid View

  1. #1
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29

    Need Help, Will Pay... CD Presentation using PDFs

    I'm having a problem simply linking a button to a PDF... I tried the:

    on(release){
    getURL("fscommand/PatientBrochure.pdf")
    }


    but it's buggy... I'm willing to pay anyone who can finish this project...it's just 6 buttons that link to PDFs .

    I created the files on a MAC but the CD ROM will be a hybrid.

    Call my cell, anytime if you can help

    516-316-3745
    Jerry

  2. #2
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    MacArtist.-
    save your money..and read some of the posts in this thread..you will find all your answers there...if you still need help I "might" be able to help you..or point you in the right direction..

    Are you just trying to open a .PDF on the users machine? From the CD? Using Acrobat reader? Are you supplying Acrobat Reader? as an install? I even think there is a thread abotu using Acrobat Reader from the CD too...(in case yoru viewer dpoesnt have it..or doesnt want to install it)

    -whispers-

  3. #3
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29

    Thanks

    Hey Whispers...the problem is I'm a MAC guy and the correct script to use is this:


    First open notepad (the real html editor), and enter this:

    start
    @ECHO off
    copy yourfile.jpg c:\windows\desktop\yourfile.jpg
    exit

    Then save this as 'save.bat' (in the save window you will have to change "Text Documents" to "All Files (*.*)")

    Then you will want to right click on that new file, select "properties" and in the properties window click on the "Program" tab and check mark "Close on Exit". And click Okay.

    Then from your flash movie you

    on (release) {
    fscommand ("exec", "save.bat");
    }

    As an alternative, you can use a batch file to open the folder containing the files and let your viewers copy the files them selves:

    start
    @ECHO off
    explorer images\folder\
    exit

    And another (more seemless) way of doing THIS is in Flash use the Get URL command to the directory containing the files. (This will work on NT/2000)

    Remember to use reletive file paths:

    images\folder\

    NOT

    d:\images\folder\

    Not everyone has their CD drives set on D:\

    NOTE This WILL work on Windows 95/98/ME but WILL NOT work on windows NT/2000. The batch scripting is different on NT/2000

    If you like this and want to learn more about bat files, one place to start is:
    http://home7.inet.tele.dk/batfiles/

    I am not connected with the above site in any way, it just seems to be a good reference.

    ...are you a PC user?... does this make sense to you?...if so, lets talk... again I'm more than willing to pay

    Thanks!
    Jerry

  4. #4
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    HI..

    ok Im a little confused.. are you trying to HELP me?..or are you trying to get help for your .PDF problem?

    If its the former..you have me TOTALLY lost..and its MY project..LOL..

    everythign I am doing so far is fine..and works...if you read my posts in this forum (Standalone & Application)

    I can copy/save my file from the CD to the users HD..I use proxy.exe (renamed) to hide the ugly DOS box..after the file copy..I wirte a text file to the users HD...with a value of OKAY or ERROR to tell if the copy was successfull or not.

    I then read this file in FLASH and go to the appropriate messge.


    When I give the user the option of browsing to the installation directory (as not all users install to C: Program Files) this is where I have the problems...either no text file..not correct value in txt file....no overwrite happens..and I cant trigger the correct respose in flash cause the text file is KAKA)


    thats where "I" stand......

    as for YOU.....Im not sure what yoru trying to do..you posted the scripts.....but you need this to happen on a MAC? Im a PC user...and I dont know anything about Applescript stuff...

    If you want to knwo how to open up .pdfs from your CD on PC let me know...


    -whispers-

  5. #5
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29

    I have the problem...

    Hey Whispers, I have the problem...my problem is I can't get my PDF to open by using a button in flash.... if you can send me your email I'll send you my files.

    thanks, any help would be great,
    Jerry

  6. #6
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    and yes it is for a CD Rom

  7. #7
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Hi MacArtist6, I can help and it won't cost you a cent If you know your users already have Acrobat on their machine then you're golden, the solution is easy and I have some FREE tools that you can use to help.

    The START command on Win9x/ME is implemented as an EXE file. On NT/2K/XP it's an intrinsic command so the way you call it on each system is different. To get around this you can get a copy of my INVOKE utility from www.extendingflash.com and use it like this from a BAT file.

    Code:
    invoke.exe open \files\pdf1.pdf
    Now you can't call this from Flash directly because Flah MX and MX04 don't allow you to use chr(9) or spaces in command line like Flash 5 did (like in the examples on the extendingflash web site). Instead you put that command in a BAT file and use my PROXY utility.

    Proxy is a FREE tool I wrote that will let you run BAT files from Flash and avoid the ugly DOS box. You can download the utility from www.northcode.com/misc/proxy.zip. There's documentation in the ZIP file, and (as Whispers pointed out) there was a big discussion about it (and some other utilities I wrote) in this thread... http://www.flashkit.com/board/showth...hreadid=519274

    So you take a copy of PROXY.EXE and rename it to PDF1.EXE and put the commands from the code block above in a file called PDF1.BAT and put both of these files (and INVOKE.EXE) in a folder called "FSCommand" in the root of your CD along with your projector. The example BAT file assumes there is a folder in the root of the CD called "files" where all your PDF files are.

    You can change the location of the PDF files (just remember to update the BAT file). You can change where the FSCommand folder and your projector are on the CD, the only restriction is that they both have to be in the same folder.

    Now to open your PDF file from Flash you can just put this in the on(release) event for your button...

    Code:
    on (release) {
       fscommand("exec", "pdf1.exe");
    }
    Create PDF2.EXE and PDF2.BAT, then PDF3.EXE and PDF3.BAT and repeat for each button and PDF file you want to open and you're done.

    If you want to integrate this with the MAC side of things you should read this thread http://www.flashkit.com/board/showth...hreadid=539618 and check out the SmartExec function I wrote to help pjutter do pretty much the same thing you're trying to do now.

    I'll be checking in here over the holidays if you need more help with this...
    Last edited by Northcode; 12-24-2004 at 12:03 PM.

  8. #8
    Junior Member
    Join Date
    Jul 2005
    Posts
    1

    I cant solve this out

    hi there

    I tried to follow this tut of yours, but in the end I cant manage it to work...

    I followed all the steps you said but when I clik the button it doesnt do any thing...

    Im wondering if I can send you my files?! Im really stuck on this....

    Hope you can help...














    Quote Originally Posted by Northcode
    Hi MacArtist6, I can help and it won't cost you a cent If you know your users already have Acrobat on their machine then you're golden, the solution is easy and I have some FREE tools that you can use to help.

    The START command on Win9x/ME is implemented as an EXE file. On NT/2K/XP it's an intrinsic command so the way you call it on each system is different. To get around this you can get a copy of my INVOKE utility from www.extendingflash.com and use it like this from a BAT file.

    Code:
    invoke.exe open \files\pdf1.pdf
    Now you can't call this from Flash directly because Flah MX and MX04 don't allow you to use chr(9) or spaces in command line like Flash 5 did (like in the examples on the extendingflash web site). Instead you put that command in a BAT file and use my PROXY utility.

    Proxy is a FREE tool I wrote that will let you run BAT files from Flash and avoid the ugly DOS box. You can download the utility from www.northcode.com/misc/proxy.zip. There's documentation in the ZIP file, and (as Whispers pointed out) there was a big discussion about it (and some other utilities I wrote) in this thread... http://www.flashkit.com/board/showth...hreadid=519274

    So you take a copy of PROXY.EXE and rename it to PDF1.EXE and put the commands from the code block above in a file called PDF1.BAT and put both of these files (and INVOKE.EXE) in a folder called "FSCommand" in the root of your CD along with your projector. The example BAT file assumes there is a folder in the root of the CD called "files" where all your PDF files are.

    You can change the location of the PDF files (just remember to update the BAT file). You can change where the FSCommand folder and your projector are on the CD, the only restriction is that they both have to be in the same folder.

    Now to open your PDF file from Flash you can just put this in the on(release) event for your button...

    Code:
    on (release) {
       fscommand("exec", "pdf1.exe");
    }
    Create PDF2.EXE and PDF2.BAT, then PDF3.EXE and PDF3.BAT and repeat for each button and PDF file you want to open and you're done.

    If you want to integrate this with the MAC side of things you should read this thread http://www.flashkit.com/board/showth...hreadid=539618 and check out the SmartExec function I wrote to help pjutter do pretty much the same thing you're trying to do now.

    I'll be checking in here over the holidays if you need more help with this...

  9. #9
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    Thanks NorthCode, you are the man on this I know.... problem is I'm on a mac (don't hate me) and this PC stuff is confussing.

    Let's talk about you finalizing this project for me... again, I'll pay you... at this point it's worth it to me...please

    Thanks again,
    Jerry

  10. #10
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Hi Jerry, I'm happy to lend a hand and this is a pretty simple job for me so I'd feel bad charging you money for it If you tell me the names of the 6 PDF files and where they are going to be on your CD then I'll whip up a little example for you where you can just steal the code from the buttons in the example and drop it in your project. If that sounds good just drop me a line at support@northcode.com

  11. #11
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    I cannot thank you enough... please look for an email I sent you thru my aol account titled "My Files..."

    your generousity is great and very appreciated.

    Jerry

  12. #12
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    HA!...at first I thought you were talking to me Northcode...lol (same name: Jerry!) I emailed you about the SWF Studio questions..

    except Im WILLING TO BUY IT! or do whatever..as long as it can do what i explained in the email/last post.

    Hopefully your suite can do the job..

    Looks as if it can..I just hope its not hard to learn the package..

    Ive already spent enought time designing the layout and functionality of the "CD"...it was one LAST custom installation .bat file (using the Copy2 and writing/checkign for text file) that has me stumped..if I have to pay the $250 price tag....just to have this DONE..so be it.

    But if not..Id just liek to know...so Im not just hanging around. From what I read...it seems that the "search ' for specific file name is just want I need to do....can/does this search the WHOLE drive? what about if they installed to say the D: drive?

    Also...if this "IS" in fact the soltion...can this be done (searching for file name cross drive/directory)...with just a .BAT file? with some commands?

    Thanks

    -whispers-

  13. #13
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    Hi NorthCode...did you get the files that I emailed you??

  14. #14
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    I have them, I'll post your ZIP file at northcode.com shortly and send you a link and login information so you can pick it up

  15. #15
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    you are the best...thank you.

    I'm actually going to be away until tomorrow night so I'll check back then.

    Does your script work for Mac also?

    Thanks,
    Jerry

  16. #16
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    No, it won't work for a MAC as is, but here's what you can do to make it work...

    Add this code to your FLA by dropping it in the first frame on the main timeline so it can be called from anywhere.

    Code:
    function SmartExec(target)
    {
       platform = $version.slice(0,3);
       
       if (platform == "WIN") 
       {
          fscommnd("exec", target + ".exe");
       } 
       else 
       {
          fscommand("exec", target + "_script");
       }
    }
    Now create a copy of this AppleScript file for each of the PDF files you want to open. You may be able to create a smarter script than this, but this one is REALLY simple

    I've assumed the CD will be named "MAP_CD" and I'm going to use the "CMS_1500.pdf" as an example to explain how to set things up.

    The AppleScript should have the same name as the PDF you want to open, so this one would be called "CMS_1500_script". The "_script" part is for the SmartExec function.

    Code:
    tell application "Finder"
       activate
       select file "CMS_1500.pdf" of folder "fscommand" of disk "MAP_CD"
       open selection
    end tell
    Then, in the on (release) events for the six buttons you have, you'll change the fscommand("exec", "CMS_1500.exe") command I added to this...

    Code:
    on (release) {
       SmartExec("CMS_1500");
    }
    When you call SmartExec from Windows it will run CMS_1500.exe and when you call it from a MAC it will run the CMS_1500_script AppleScript.

    Now that wasn't so bad was it?


  17. #17
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    OK I got all that...and the CD is working great on the PC, but the PDFs are not opening on the MAC..... I'll email you my files if you get a chance take a look... my applescripts are working off the disk fine... I screwed something up on the flash script end

    My button script:

    on (release) {
    SmartExec("PatientBrochure_script");
    }

    is that right?
    Last edited by MacArtist6; 12-29-2004 at 05:04 PM.

  18. #18
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Nope, you don't need the _script, the SmartExec function will add that for you.

    Code:
    on (release)
    {
       SmartExec("PatientBrochure");
    }
    Hmmm, if you did it your way it should have made the PC version stop working too. Did you use separate FLAs for the MAC and PC? You don't have to, that's the idea behind the SmartExec - it figures out which platform it's running on and calls either the EXE or the AppleScript.

  19. #19
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    Yes I do have seperate files....

    it's still not working for me...question: do I name the Applescript file (example) "CMS_1500_script" or do I leave the _script off that as well?

    also is this the entire script for the button

    on (release) {
    SmartExec("FDA_Letter");


    meaning do I delete or add to the PC script:

    on(release){
    //getURL("fscommand/CMS_1500.pdf")
    fscommand("exec", "CMS_1500.exe");
    }

    am I making sense?
    Last edited by MacArtist6; 12-30-2004 at 12:34 AM.

  20. #20
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    SmartExec always uses the same target parameter and then, based on the platform you're running on, SmartExec tacks on ".exe" or "_script" and tries to launch that file. So the only thing in your button release event should be a call to SmartExec and the base name of the PDF file you want to open (i.e. the name of the PDF file without the extension).

    Code:
    function SmartExec(target)
    {
       platform = $version.slice(0,3);
       
       if (platform == "WIN") 
       {
          fscommnd("exec", target + ".exe");
       } 
       else 
       {
          fscommand("exec", target + "_script");
       }
    }
    The agreement required to make this work is that in the fscommand directory with the PDF files, there has to be an EXE (and a BAT) file for every PDF and an AppleScript file for every PDF. The names of these files are the same as the names of the base PDF files with .EXE (and .BAT) and _script tacked onto them. This is all done for the benefit of SmartExec.

    Because of SmartExec, the code for the MAC and the ActionScript code for Windows is EXACTLY the same. So you can have one PDF file and generate both the MAC and Windows projectors from the same FLA (unless you have some other reason to keep two FLAs).

    So for the call to SmartExec("CMS_1500") to work in both cases you need to have the following files in your fscommand directory.

    CMS_1500.PDF
    CMS_1500.BAT
    CMS_1500.EXE (copy of proxy.exe, renamed)
    CMS_1500_script (the AppleScript script 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