dcsimg
A Flash Developer Resource Site

Page 2 of 4 FirstFirst 1234 LastLast
Results 21 to 40 of 65

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

  1. #21
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    In both cases, for the Mac and Windows, the button script should look like this...

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

  2. #22
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    It's still not working... I'm sure I did everything you said, but I must have missed something... my fscommand folder is set up correctly and my actionscripts work...I'm guessing I messed something up with the first frame script... is this correct?

    function SmartExec(target)
    {
    platform = $version.slice(0,3);

    if (platform == "WIN")
    {
    fscommnd("exec", target + ".exe");
    }
    else
    {
    fscommand("exec", target + "_script");
    }
    }


    again thank you for your patience with me

    I'll email you my fla file if you get a chance take a look (email to the T.G. address)

  3. #23
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Looks okay except for the typo "fscommnd" in the call to the WIN version. I have your files here, I'll copy them over to the old G4 and see if I can figure out what's going wrong.

  4. #24
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    I fixed the type-o and it's still not working...


    NorthCode, have a great new year...thanks for all your help
    Last edited by MacArtist6; 12-31-2004 at 08:22 PM.

  5. #25
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425

    fscommand trouble

    This thread has been EXTREMELY helpful.

    I'm having some problems implementing the fscommand method, though, and I'm wondering if anyone can help?

    Northcode, I slimmed down your SmartExec() function to troubleshoot to this:

    function SmartExec(target)
    {
    /* platform = $version.slice(0,3);

    if (platform == "WIN")
    {
    fscommand("exec", target + ".exe");
    }
    else
    { */
    trace('SmartExec triggered');
    fscommand("exec", "test_script");
    // }
    }

    So I know the function is running thanks to the trace() but it still won't run the test_script.

    According to this script, 'test_script' should just be an executable Applescript application located in the same directory as the .swf calling it right?

    The Applescript works by itself, so somethingmust be wrong with how I'm calling it in Flash...

    Help?? Thanks!
    :: scott ::

  6. #26
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    The EXEC fscommand only works in projectors (not SWFs) and the thing you want to exec has to be in a folder called "fscommand".

  7. #27
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425
    oooohh. ok. thanks!

    wait though, i did as prescribed but it still won't work..

    i've got the function running successfully in the projector, and the 'test_script' residing in a folder at the same level as the projector called 'fscommand', but still the Applescript doesn't execute when the function is run...

    Any other ideas?
    Last edited by scottPadgett; 03-14-2005 at 03:23 PM.
    :: scott ::

  8. #28
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Compile the AppleScript to an application OR rename the script to test_script.scpt and change the EXEC function to use the name with the extension.

  9. #29
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425

    one more thing too

    I get a syntax error in the Actionscript debugger telling me that there's no slice() method, when I try to publish the projector.

    Does that statement really work?
    :: scott ::

  10. #30
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425

    Applescript working now

    Thanks, Northcode. I added the .scpt extension to the file and the Mac automatically renamed it:

    test_script.scpt.app

    this did the trick after changing the name respecitively in the Actionscript...


    Thanks!
    :: scott ::

  11. #31
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425

    syntax problems

    OK, so there must be something wrong with the SmartExec() as written.

    I get the error upon publishing complaining about the slice() method, and if I comment out that variable assignment, the script runs properly...

    Any help there?

    PS, it's been a GREAT help that you took the time to do all of this work for shmos like me.
    :: scott ::

  12. #32
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Try replacing this line from the original script

    platform = $version.slice(0,3);

    with this one which will work with more versions of Flash

    platform = substring($version,0,3);

    AND/OR make sure that the SmartExec function is at the root of your movie or $version won't exist. So you can also try using _root.$version in place of $version (if the substring trick doesn't work).

  13. #33
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425
    Thanks Northcode, I'm going to try this fix as soon as I get a second.
    :: scott ::

  14. #34
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425

    worked like a charm

    you're prescribed solution did the trick.

    thanks, northcode


    -s
    :: scott ::

  15. #35
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    Hey Northcode, it's your old friend MacArtist... you had created .bat and .exe files for me to open PDFs off CD-Roms... I need to change the names of the PDFs, what program can I edit the .bat and .exe files in?

    Thank you again.

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

    Just a thought

    Hi Nothcode, I've attached a copy of one of the files you made for me... I was thinking I should simply name my PDFs "01.pdf", "02.pdf", "03.pdf" etc...

    Then I could use these as my templates... what's your thoughts?
    Attached Files Attached Files

  17. #37
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    You don't need to edit the EXE files, just make copies of CMS_1500.exe and rename the copies to 01.exe, 02.exe, etc. You'll need to make copies of the BAT files, rename them the same way and edit the name of the PDF file inside the BAT file to match. The BAT files are really just text files so you can edit them with notepad or any editor that just saves as plain text.

  18. #38
    Junior Member
    Join Date
    Oct 2002
    Location
    Long Island, New York
    Posts
    29
    worked like a charm... you're the best

  19. #39
    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...

  20. #40
    Member
    Join Date
    Jul 2005
    Posts
    79
    some days before i have this problem too. but now i have solution.

    first of all make batch file of any pdf or word doc file.

    ENTER this code in notepad:

    @ECHO OFF

    filename.extension

    EXIT

    then save as mypdf.bat

    here filename is ur pdf or word document file name and there extension e.g one.pdf or one.doc

    now place this file with pdf or word doc file in folder named "fscommand"

    in flash write a code on button

    on (release){

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

    }

    and make projector file (.exe) of this flash movie

    now remember both ur fscommand folder and ur projector are on same place.

    run the projector and click on button
    then u will see that u r successful

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