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.
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!
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,
- 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!
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?
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).
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
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.
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
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.
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.
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.
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.
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"
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?
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,
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!
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.
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.
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.