This is actually to do with the PDF renderer, not TeX. I don't have
gnash installed, nor any flash files to hand, but I tested with the following file:
evince then the second link opened my department homepage, as expected, but the first produced the error:
Error stating file `/path/to/directory/where/I/launched/evince/firefox http:/www.math.ntnu.no': No such file or directory
evince is trying to launch a program in its current directory called
firefox http://www.math.ntnu.no/ (well, modulo disappearing slashes).
However, when I try this with
xpdf, my usual PDF reader, then when I click on the link it says:
About to execute the command: firefox http://www.math.ntnu.no/ &
and asks me if I really want to do this. If I click "OK" then I get what I expect. This experiment suggests that there is some latitude in what the viewer gets to do.
Looking at the resulting PDF file, I see the following:
4 0 obj
<</Border[0 0 1]/Subtype/Link/C[0 .7 .7]/A<</F(firefox http://www.math.ntnu.no/)/S/Launch>>/Type/Annot/Rect[147.716 656.239 178.213 665.15]/H/I>>
5 0 obj
<</Border[0 0 1]/Subtype/Link/C[0 1 1]/A<</URI(http://www.math.ntnu.no/)/Type/Action/S/URI>>/Type/Annot/Rect[179.541 656.239 210.038 665.15]/H/I>>
(Note that the slashes are as they should be). So a
run: directive gets converted to a
Launch action, and an
http: directive to a
Looking at the PDF specs (or at least, Adobe's free copy thereof) I learnt more than I wanted to about the internals of PDFs, including launch actions. These are detailed in Section 22.214.171.124 (p422, internal numbering, p430, external). What is interesting is that some parts of this have the tag "not yet defined". Whilst I don't think that these are relevant here (as they refer to OS-specific features and these aren't used), I think that this implies that the specification here might be subject to revision as unusual use-cases appear. (Seeing this just after reading about Windows behaviour with spaces in program names is an interesting juxtaposition.)
So my inference (and it is nothing more) is that exactly what a PDF viewer does when it encounters a "Launch" action is pretty much up to that viewer. Unfortunately, this includes whether to regard the string as a single command name or to break it up. Actually, I suspect that the question is whether to pass it to the relevant
open command (or maybe the shell) as a quoted string or not.
To avoid this, I recommend writing a small script that calls the flash viewer on your program. Something like:
and then call that from within your file.
With a bit of
\write trickery, you could even get
tex to create that file itself.