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

Flash SWF links in Acrobat 9

watts
Registered: Nov 3 2008
Posts: 3

I have a Flash cs4 swf with links to pdf files. I have placed the swf in an Acrobat 9 PDF and I want the links to call the external PDFs. If that isn't possible, I want it to link to pages within the final pdf.
Here is my actionscript in Flash for the links (which work correctly in the swf):

africa_btn.addEventListener(MouseEvent.MOUSE_DOWN, africaHandler);
function africaHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("docs/8115_S_S Dir_Africa.pdf"));
}
mideast_btn.addEventListener(MouseEvent.MOUSE_DOWN, mideastHandler);
function mideastHandler(event:MouseEvent):void {
navigateToURL(new URLRequest("docs/8115_S_S Dir_Middle_East.pdf"));

}

I know I have to add document Javascript in Acrobat to make the swf function. But I a lost.

I can only find flex documentation for this issue.

Thanks in advance.

My Product Information:
Acrobat Pro 9.0, Macintosh
joshcorey
Registered: Jul 14 2008
Posts: 79
What is your intended delivery method? It looks as though you are trying to use relative URL's (maybe you are building a CD and all the resources are on the same file system, I am not sure of a lot of other cases where this would be useful). There is a bug in Acrobat 9 related to relative paths (watch for future release with a bug fix), so this will not work at this time.

Without knowing more about your delivery method I will try to give you some options:

1) You can host the PDF's on a server use absolute paths for the PDF's it will work just fine using your code (replacing the relative paths with absolute paths to the PDF's) and no javascript required.

2) Another option is to use an externalInterface.call in Actionscript to javascript and use javascript to do one of two things, navigate to a page in the PDF (an option you mentioned as a back up) or to open a file attachment (PDF attachment on the source PDF, not as a resource to the ). I don't know the javascript API myself but there are API's for both methods. If you do go the first route (navigating to a page within the PDF) take a look at the following blog:

http://blogs.adobe.com/pdfdevjunkie/2008/09/how_do_you_close_a_floating_ri.php

The blog shows how to work around a bug where Acrobat can crash when programmatically changing pages in the PDF when there is an active Richmedia annotation.


AFTER the bug on relative URL's is fixed you will have the following options:

1) Host both the SWF and the PDF's on a server and use the absolute URL to your SWF as the source for your Richmedia annotation (URL's are supported). (Remember this will not work until there is an update to Acrobat 9)

2) You could (again, after this bug is fixed) host the PDF's and SWF and load the SWF via "loader" from an embedded SWF. (Remember this will not work until there is an update to Acrobat 9)

I would be happy to clarify anything I said. Flash security is not necessarily easy to understand and it gets trickier in a PDF. If this hasn't helped let me know your delivery method and I will take another look.
watts
Registered: Nov 3 2008
Posts: 3
Yes, you are correct, the project is for a CD. Unfortunately, the client can't wait for the update. I will attempt one of the API solutions.

No doubt, that will raise more questions.
Thanks for your help!