dcsimg
A Flash Developer Resource Site

Page 3 of 4 FirstFirst 1234 LastLast
Results 41 to 60 of 65

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

  1. #41
    Member
    Join Date
    Jul 2005
    Posts
    79
    Hey try this too

    in notepad just write

    start filename.pdf

    and save it as .bat

  2. #42
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    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...
    It's been a long and winding thread susani, what part were you having trouble with?

  3. #43
    Member
    Join Date
    Jul 2005
    Posts
    79

    i'm sending u the example file

    Hello

    i'm sending u the example file

    In this example file there are 2 buttons
    By clicking first button a dos prompt window open and by clicking 2nd button dos prompt window open just for a moment.

    check it out

    BUT FIRST OPEN THE .fla FILE AND MAKE .exe FIle THROUGH PUBLISH SETTINGS AND PLACE THAT PROJECTOR FILE IN EXAMPLE FOLDER THEN RUN THAT FILE

    best of luck
    Attached Files Attached Files

  4. #44
    Member
    Join Date
    Jul 2005
    Posts
    79

    this is the right file

    Hello

    i'm sending u the example file

    In this example file there are 2 buttons
    By clicking first button a dos prompt window open and by clicking 2nd button dos prompt window open just for a moment.

    check it out

    BUT FIRST OPEN THE .fla FILE AND MAKE .exe FIle THROUGH PUBLISH SETTINGS AND PLACE THAT PROJECTOR FILE IN EXAMPLE FOLDER THEN RUN THAT FILE

    best of luck
    Attached Files Attached Files

  5. #45
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425
    Wierd. I got this Northcode solution working for my own project, but I can't get yours to work. In fact, I couldn't even get the batch file to run by itself, until I renamed the file back to include the .bat extension visually in the XP explorer window.

    Would like to know you solution.
    :: scott ::

  6. #46
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    In the second example you posted both buttons work fine for me. That's on a Windows 2000 system with Flash MX 2004 (7.2) and Acrobat Reader version 6 installed.

    If you add a PAUSE statement at the end of your BAT files that will keep the DOS window open so you can see any errors that might be displayed too quickly for you to see.

    Also, just FYI, You don't need the EXIT at the end of the BAT file. If you keep the EXIT command, make sure the PAUSE appears first or the window will close before it gets to the PAUSE statement.

  7. #47
    Member
    Join Date
    Jul 2005
    Posts
    79
    it is also working in window XP on my computer adn i have checked it on other computers also.
    Mr. Northcode u r talking about PAUSE statement can u explain it more because i'm little bit confused.
    Mr.Scott what u r saying i cant understand can u reply me again that what u r saying.

    Regards

  8. #48
    flip-flopper scottPadgett's Avatar
    Join Date
    Jan 2005
    Location
    Boston
    Posts
    425
    OK, that last file that you posted works fine for me on XP, now, too. I was trying to run it from a network folder and I believe .bat file didn't like that. I got this 'UNC paths are not valid/allowed' warning.

    Seems fine now.
    :: scott ::

  9. #49
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    PAUSE is just another command you can use in a BAT file. It pauses the BAT file until you press a key and gives you a chance to look at the output before it disappears. Just put PAUSE on a line by itself in the BAT file. You'll want to remove it from the finished product though, it's just for testing.

  10. #50
    Member
    Join Date
    Jul 2005
    Posts
    79
    OK thats nice
    and i will apply this statement PAUSE to check

  11. #51
    Junior Member
    Join Date
    Oct 2005
    Location
    Pasadena, California
    Posts
    9

    Dynamic Possible?

    Northcode-

    I used your code to great succes - thanks for the generous help! I'm curious though if it's possible to have the code work dynamically, so that one does not have to create pdf1.exe, pdf2.exe, pdf3.exe, etc. My current project has about 40 pdf links and a dynamic capability would seem to be a much less cumbersome way to go.

    Thanks again.

  12. #52
    Junior Member
    Join Date
    Sep 2005
    Posts
    1
    NorthCode-

    I am also trying to figure this out but rather than send you more files to look at would it just be possible for you to post like a mini project.

    you know just something super simple that launched a single pdf file from a button action. If you could post that with all necessary scripts .bat .exe and proper file structure. I think that would be the most beneficial to alot of us here and may stop the need to constantly ask you to look at our files.

    If we can see 1 example fully realised I think it owuld be safe to assume that we should beable to figure out how to add extra pdfs.

    thanks
    betatone

  13. #53
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    I actually just posted step-by-step instructions for doing this for jujumon in this thread http://www.flashkit.com/board/showthread.php?t=660265 (here in the standalone & applications forum) along with an FLA in MX 2004 format (let me know if you need it in MX or something) and all of the other required files

    To answer incubox's question... To do this dynamically you would need to be able to pass parameters to the EXE file, which is what Macromedia changed in MX. You can't pass parameters to applications via the EXEC command any more.

    If you're willing to shell out some bucks then you can pick up one of the many third party swf2exe applications. These tools extend what you can do from Flash and they DO allow you to pass parameters to EXE files and most of them have special commands that allow you to open PDF files and such directly.

    SWF Studio http://www.northcode.com
    SWiSH Studio http://www.swishzone.com
    mProjector http://www.screentime.com
    Jugglor http://www.jugglor.com
    SWFKit http://www.swfkit.com
    Zinc http://www.multidmedia.com

    In my product, SWF Studio, you can just say ssCore.Shell.invoke({path:"startdir://file1.pdf"}) to open the PDF file in Acrobat Reader (or whatever PDF viewer the user has installed). Because you don't need an external helper EXE you can just open the PDF files by name. Our syntax may look a bit foreign at first, it's out very own ActionScript API and it provides a powerful and convenient way to access our extended functionality from Flash.
    Last edited by Northcode; 11-17-2005 at 05:37 PM.

  14. #54
    Junior Member
    Join Date
    Feb 2002
    Posts
    7

    Question

    Northcode -
    I followed your step by step instructions and it works like a charm! Thank You.
    Since this thread is old, I wasn't sure if there were any updates to this in regards to applying this to multiple PDFs. I have aprox 200 PDFs to apply this functionality to for CD delivery.
    You mentioned using SWF Studio to dynamically make this happen. I downloaded a trial version to check it out, but am clueless on how to achieve this.
    Can you guide me in the right direction?

    Thanks !
    dfreem5

  15. #55
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    If the PDF file names have a structured naming convention (file1.pdf, file2.pdf, etc) then you can just construct the file name that you're passing Shell.invoke like this...

    filename = "file" + theNumber + ".pdf";
    ssCore.Shell.invoke({path:"startdir://" + filename});

    But how you do it will depend on how you're trying to launch the PDF files. Is the user selecting a file from a list? browsing the filesystem? selecting from 1 ot 200 buttons?

    If you can provide more detail about the mechanism you're using for selecting the PDF to be launched I can be more specific.

  16. #56
    Junior Member
    Join Date
    Feb 2002
    Posts
    7
    The print button is calling PDFs dynamically using a getUrl call and the button is not on stage. The PDFs are not using a structured naming convention (file1.pdf, file2.pdf, etc), nor are they all in the same directory.

    I'd like to send the .fla in question to you directly, if possible. (Would prefer to not post client file here).
    Thank you!

  17. #57
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Sure, send it to support@northcode.com and I'll have a look.

  18. #58
    Junior Member
    Join Date
    Feb 2002
    Posts
    3

    Launching PDF on a Mac Projector trouble

    Thanks Northcode for your proxy solution it worked great and your excellent posts have been extremely helpful to me so far. I know this subject has been rehashed a bit but I'm having trouble with opening a pdf on a Mac projector developed on a PC.

    Firstly, I made the Applescript on a borrowed Mac (OS X 10.5.5) which works as it should. Then I zipped it up (on the Mac) send it to myself and via email (don't unzip) and use CD Everywhere to add from zip archive to burn a hybrid CD. When I run the Mac projector on the borrowed Mac it doesn't work and looking on the disk it seems the script may be damaged because when I click it is says "classic environment not supported" and the icon is different from the original.

    For those who are successful in making a hybrid CD how are you getting the script to your PC without breaking it? Or is it something else I'm missing?


    I have an fscommand folder with the PDF and script in it.

    My button code is:

    Code:
    on (release){
    
    var os:String = System.capabilities.os.substr(0, 3);
    if (os == "Win") {
      fscommand ("exec","74547_CH010_lecture.exe");
    } else if (os == "Mac") {
      fscommand ("exec","74547_CH010_lecture.app");
    } else {
      // Must be Unix or Linux
    }
    
    }

  19. #59
    Junior Member
    Join Date
    Feb 2002
    Posts
    3

    Sorted it out

    Alrighty then finally after tons of hair pulling it's working, and here is what I did to get PDF's to launch on a hybrid CD from a Mac projector.

    I'll just include what I did for the Mac (OS X 10.5.5) as Northcode's Proxy solution is the only way to go for the PC side of things.

    - First create an Applescript. This one worked for me. Tip: If you have your CD laid out already but have not got the scripts written, you can go into the script editor and record your actions opening the PDF to get a script that is for sure to work. After creating the script with your CD still in the Mac double click the script to try it out.
    Code:
    tell application "Finder"
    activate
    select file"74547_CH010_lecture.pdf" of folder"fscommand"of disk"LectureCD"
    open selection
    end tell
    save as an application and you will have "yourPDF.app" or in my case 74547_CH010_lecture.app

    - I used fscommand as my folder and I believe you have to put your PDF's and script in this folder or it won't work.

    - I used the button code here (change it to suit your files)
    Code:
    on (release){
    
    var os:String = System.capabilities.os.substr(0, 3);
    if (os == "Win") {
      fscommand ("exec","74547_CH010_lecture.exe");
    } else if (os == "Mac") {
      fscommand ("exec","74547_CH010_lecture.app");
    } else {
      // Must be Unix or Linux
    }
    
    }
    - Since I was developing on a PC and just writing the scripts on a Mac the biggest challenge which I had to find out the hard way, was that you CANNOT just zip it up and email yourself the .app script and burn it to CD as it breaks the script (probably resource forks).

    I bought CD Everywhere Pro and tried to burn with the "get from ZIP Archive" thinking that will preserve the forks but that did not work.

    You have to TAR it up on the Mac (I used TarPit, it's free) and that preserves the resource forks, then it is a simple matter in CD Everywhere to use the "get from TAR Archive" feature to include it in your project. I used CD Everywhere because it will decode the TAR file on the fly and the .app never touches the PC thus preserving it. CD Everywhere is expensive but it works. (not a paid endorsement) It seems that .ZIP doesn't preserve the file properly but .TAR does.

    - Create image file (.iso) and burn

    The biggest problem was getting that script over to the PC and burning it, but once that was solved it was easy-peasy

    Time to buck up on my AS3 and move on to Adobe Air...

  20. #60
    Junior Member
    Join Date
    Feb 2010
    Location
    Detroit, MI
    Posts
    4
    I am new to Flash, I have a project that will be a standalone CD to retreive pdf files.
    I have read all the posts in this discussion and they seem to all refer to new versions of Flash ( after ver. 5). I am using Flash 5, and the problem is getting the pdf file to open with a button.
    Do I need to use the .bat files with this old of a version?
    Can I make this work with this older version?

    This cd will only be used in PC not Mac if this matters.

    I have tried using the getURL and it just opens a blank explorer page.

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