These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

How does one make Flash buttons work on a PDF?

dbwavell
Registered: May 14 2011
Posts: 2
Answered

Say you make a little animation in Flash - that includes some buttons, which you want to use for navigation within the PFF - using actionSctipt function gotoNamedDest(myDestination). (Of course, you need to set up the named destinations in the PDF separately).
 
I can embed the animation quite happily, and the buttons work if I ask them to call a web page (using the Flash function getURL().) So that means the Acrobat Reader is listening to the Flash animation's output.
 
However, the Flash function sfcommand(), which is the main way I know for passing Flash instructions to web pages, doesn't seem to have any effect within a PDF.
 
Maybe I have the syntax wrong? Or maybe there is another Flash call I should use? Your help would be very gratefully received!

My Product Information:
Acrobat Pro 10.0.1, Windows
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Accepted Answer
You will need to use Actionscript 3 and the ExternalInterface class to communicate with the host environment (the PDF), and either call a document-level JavaScript function in the PDF file, or use the eval() method to tunnel code to the JS interpreter.

See our Tech Talk for more info:

http://acrobatusers.com/events/2129/tech-talk-talking-3d-and-flash-acrobat-javascript
dbwavell
Registered: May 14 2011
Posts: 2
Many thanks Dave. The Tech Talk was pretty illuminating, and certainly made your answer easy enough to understand.

The latest version of Flash that I own is 5.0 for Macintosh, and I have spent some time with that putting together a neat animation. From what you say I will not be able to get any further without using Actionscript 3 (which was introduced in 2006). I suppose that means buying a later version of Flash and importing my animation into it - and rewriting the buttons code from that point. Is that so?

And in that case I shall have to ask myself whether this small exercise is worth the expense. The main thing I need to do is to stream videos from Vimeo and YouTube - and you have illustrated how the latter can be achieved. (Vimeo is easy anyway, because they give a .swf file address to put in the box in Acrobat).

Incidentally, an alternative approach regarding the animation I have done is to put invisible Acrobat navigation buttons on top of (or underneath) the Flash ones. The links do work and take one to the right place. The only disadantage is that the Flash buttons will not then highlight correctly to show a mouseup - and only change to show a mouseover if the mouse pointer hits the edge of the (circular) Flash button before it covers the edge of the (rectangular) PDF button.

Mazny thanks for your attention, especially over the weekend! I wonder what you think?