A Flash Developer Resource Site

Page 1 of 2 12 LastLast
Results 1 to 20 of 23

Thread: Open pdf on CD from flash?

  1. #1
    Junior Member
    Join Date
    Mar 2004
    Posts
    13

    Open pdf on CD from flash?

    Hi,

    I have a flash application that is going to be distributed on CD. In it there need to be links to open pdf files that are on the CD. What would be the actionscript to get flash to look on the CD?
    I searech ed for any like topics but coiuldn't find any.

    Thanks for any help. This is very urgent

    -Mark

  2. #2
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    Hi, you can use either the EXEC FSCommand or the getURL command and simply reference the path to the PDF file.

    Alternatively, download a copy of Flash Studio PRO v2 and you can load the PDF file either directly IN the projector or in a sperate window. I hope this helps!

  3. #3
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    I have seen Gambini provide this solution before but I've never been able to get it to work. Gambini-how about a working example?

    On the other hand, I was able to get this to work quite nicely using proxy.exe, a free utility from Northcode. Check out this thread for links to the utility and instructions on using it,

    http://www.flashkit.com/board/showth...hreadid=519274


    basically you do the following,

    - create a folder called "fscommand" directly beneath the folder where your Flash EXE will be
    - put your PDF in the fscommand folder (let's call it "yourpdf.pdf")
    - create a batch file with the same name (yourpdf.bat)
    - put one line in the batch file with "yourpdf.pdf" (without the quotes!)
    - save Northcode's proxy.exe into the fscommand folder but rename it yourpdf.exe
    - in your Flash, put the following on a button,
    fscommand("EXEC", "yourpdf.exe");

    now when they click the button, Northcode's proxy.exe will run the batch file silently (without the ugly black DOS window) and the batch file will load your PDF. works sweet!
    Last edited by XcVbSdRw; 03-01-2004 at 05:36 PM.

  4. #4
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    Originally posted by XcVbSdRw
    I have seen Gambini provide this solution before but I've never been able to get it to work. Gambini-how about a working example?
    Sure....

    Code:
    file = "myFile.pdf";
    fscommand("flashstudio.exec","file");
    This will load the PDF directly in a new external window.
    Code:
    id = "0"; 
    xPosition = "0"; 
    yPosition = "0"; 
    myWidth = "400"; 
    myHeight = "300"; 
    pdf = "myFile.pdf"; 
    fscommand("flashstudio.pdf_load", "id,xPosition,yPosition,myWidth,myHeight,pdf");
    This code will load the PDF directly IN your projector at the specified location and size (custom).

    Get Flash Studio PRO v2 at http://www.multidmedia.com

  5. #5
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    Gambini - unfortunately, the example you gave requires the use of your software.

    the suggestion I provided works without your software. it does use the northcode utility but that utility is truly free -- free of cost AND free of any nag/promo screens (as I believe are present in the free version of your software).

  6. #6
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Okay XcVbSdRw (what does that stand for anyway?) I, you and Gambini all knew that when you asked him to show a working demo it was going to done using FSP. It's a bit unfair to jump out of the bushes with a stick, after the fact, and give him a whack for not offering a free solution

  7. #7
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    actually it is not in the least unfair!

    I have seen this post several times answering this question by stating something like "you can use either the EXEC FSCommand or the getURL command and simply reference the path to the PDF file." with no mention of the need for additional software.

    but in my experience, this does not actually work using straight Flash.

    what I was asking for was an example using straight Flash (as was implied in his original response), not an example using a 3rd-party product. and, I would love to be corrected here if you can actually do this in Flash.
    Last edited by XcVbSdRw; 03-02-2004 at 10:14 AM.

  8. #8
    Junior Member
    Join Date
    Mar 2004
    Posts
    13

    Thanks

    thanks for the tips guys, I went to the Northcode site but I could nopt find a link to the proxy.exe program. It sound like it's going to be the easiest way but I can't seem to locate it so if someone could post a link or the section on the site where it is that would be appreciated

    Thanks Muchly,
    Mark

  9. #9
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    You can download it from www.northcode.com/misc/proxy.zip and find a long thread talking about it and some other utility programs over here -> Northcode's Runtime.exe verses Proxy.exe. If you hunt around this forum you can find a couple more utilities I wrote that you might find useful as well.
    Last edited by Northcode; 03-02-2004 at 12:55 PM.

  10. #10
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    Originally posted by XcVbSdRw
    I have seen this post several times answering this question by stating something like "you can use either the EXEC FSCommand or the getURL command and simply reference the path to the PDF file." with no mention of the need for additional software.
    In my original post I said you can use EXEC or getURL which ARE free solutions within Flash, OR (and here's the KEY word) ALTERNATIVELY use Flash Studio PRO to accomplish this.

    XcVbSdRw, you're no stranger to this board so I've very surprised you don't know how to use getURL or the EXEC fscommand.
    Code:
    on(release){
    	getURL("myfile.pdf")
    }
    Pretty simple eh? Oh, and FREE.

  11. #11
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    Gambini-sorry! I thought this would not work dependably due to GetURL problems on some operating systems. and, it is my understanding that the EXEC method depends on batch files with the undesirable DOS window.

    in the final analysis, I believe the use of the free utility proxy.exe is the best solution unless there is a desire or need for 3rd-party software for some of the admittedly cool features you (and others) provide.

    bottom line--I feel commercial solutions should not be pitched in this forum when a free solution will do what the person requested.

  12. #12
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    Originally posted by XcVbSdRw
    Gambini-sorry! I thought this would not work dependably due to GetURL problems on some operating systems. and, it is my understanding that the EXEC method depends on batch files with the undesirable DOS window.
    You can execute a PDF directly without the need of a bat file - the pdf file just needs to be in a folder called "fscommand"
    bottom line--I feel commercial solutions should not be pitched in this forum when a free solution will do what the person requested.
    Free solutions are provided (getURL and EXEC), and a commercial solution also suggested incase the user requires additional functionality.

  13. #13
    Junior Member
    Join Date
    Mar 2004
    Posts
    13
    Thanks Guys

    I got it to work with Northcodes proxy.exe

    works like a charm

    -Mark

  14. #14
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    Originally posted by Gambini
    You can execute a PDF directly without the need of a bat file - the pdf file just needs to be in a folder called "fscommand"
    I know you have said this several times in this forum; the current thread, http://www.flashkit.com/board/showth...=fscommandEXEC and http://www.flashkit.com/board/showth...fscommandEXEC.

    And that is precisely what I was asking for an example of earlier in this thread. I do not believe it will work as you have said. I think it used to work that way in Flash 5 but I do not think MX allows anything except EXE and BAT to be executed in the fscommand folder.

    I'm not trying to beat a dead horse here or just beat up on you, I simply think it is important to clear this up and make sure it has been stated correctly for the benefit of all!

    If I'm wrong please show me where and I'll gladly eat my hat!

    Below is a simple example I created where there is a PDF located in the fscommand folder. The button on the left has the following code and it works by launching a web browser and loading the PDF inside the web browser (possibly an undesirable side effect),

    on(release){
    getURL("fscommand\\test.pdf")
    }

    (of course I could remove "fscommand\\" and simply colocate the PDF with my SWF using this technique)


    The button on the right has the code you have said would work,

    on(release){
    fscommand("EXEC", "test.pdf");
    }

    However, on my system (WinXP, Flash MX) it does not work. Am I doing something wrong or is your code incorrect?
    Attached Files Attached Files

  15. #15
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    XcVbSdRw, you are correct. EXECing a PDF file might work in FSP, but it doesn't work from a pure Flash projector (or SWF) at least in MX.

  16. #16
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    The code I gave was using getURL, not EXEC.

  17. #17
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    Originally posted by Gambini
    The code I gave was using getURL, not EXEC.
    But your first response in this thread was "you can use either the EXEC FSCommand or the getURL command and simply reference the path to the PDF file". Then you stated "you can use EXEC or getURL which ARE free solutions within Flash".

    And on at least two other occasions you said this works using EXEC and you gave code examples,

    http://www.flashkit.com/board/showth...=fscommandEXEC

    http://www.flashkit.com/board/showth...=fscommandEXEC

    I would not be so quick to nail you on this if you weren't so quick to promote your commercial product around here. Giving incorrect advice (whether intentional or not) followed by a product pitch is what bugs me!
    Last edited by XcVbSdRw; 03-05-2004 at 05:10 AM.

  18. #18
    Banned By GMF Wannabe Gambini's Avatar
    Join Date
    Oct 2000
    Posts
    976
    And what bugs me is how much you **** *** with certain people. You CAN use both solutions I provided albeit they are not perfect due to restrictions imposed by macromedia/Actionscript.

    In an effort to put an end to this silly posting, lets agree to disagree.
    Last edited by Northcode; 03-05-2004 at 12:43 PM.

  19. #19
    Senior Member
    Join Date
    Mar 2002
    Posts
    249
    Originally posted by Gambini
    You CAN use both solutions I provided albeit they are not perfect due to restrictions imposed by macromedia/Actionscript.

    In an effort to put an end to this silly posting, lets agree to disagree.
    It is not a silly posting when someone claims a technique works and someone else correctly points out that it does not work!

    If "You CAN use both solutions I provided" show us an example where EXEC will open a PDF directly without a batch file or a 3rd-party tool! If you cannot do this then simply admit it and move on! There is no "agree to disagree"; the code you provided either works or does not work.

  20. #20
    Tim (Super Moderator) Northcode's Avatar
    Join Date
    Dec 2000
    Location
    Whitehorse YT
    Posts
    3,766
    Gambini, you have said, on more than one occassion, that You can execute a PDF directly without the need of a bat file - the pdf file just needs to be in a folder called "fscommand" and you have also shown code snippets that use the Flash EXEC fscommand on a PDF file (XcVbSdRw posted some links if you need to refresh your memory).

    It would be great to be able to EXEC a PDF file from Flash and not have to open it in a browser window using getURL (with all the associated problems). I've tried this with Flash 5, MX and MX 2004, using Acrobat Reader 5 and 6, with the PDF file in the fscommand directory and outside it, but I just can't make it to work.

    If I'm missing some setting in Flash, a trick that makes this work, or a limitation like it only works from the root of the C: drive, from a HD (or whatever) I'd love find out how it's done.

    And what bugs me is how much you **** *** with certain people.
    <moderatorhat>
    If you can't express your opinion without swearing, regardless of how innoffensive you think it might be, then please don't press the submit button. First time, the post gets edited, next time the post gets deleted, repeat offenders will be referred to the webmaster. This applies to everyone.
    </moderatorhat>

    I don't see how pointing people at a free solution is "kissing bum". XcVbSdRw doesn't get anything from it except the occasional free utility, but I do that for everyone. If he's saying nice stuff about me, it's probably because I sometimes do nice things for people, like provide free utilities. He still growls at me about shortcomings in SWF Studio, that hasn't let up one bit (as much as I wish it might), and he doesn't let me off the hook when I'm wrong either.

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