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

Acrobat crashes when changing pdf page from flash

eidosk
Registered: Oct 1 2008
Posts: 4
Answered

Hi all,

I have a swf embedded into a pdf and I would like to change my pdf page from flash.

here is my javascript code inside the pdf:

//<Document-Level>
//<ACRO_source>gotoPage()</ACRO_source>
//<ACRO_script>
/*********** belongs to: Document-Level:gotoPage() ***********/
function gotoPage(page)
{
    console.println("Going to: " + page)
    this.pageNum = page;
}
//</ACRO_script>
//</Document-Level>

here is my actionScript code inside flash:

g2_btn.addEventListener(MouseEvent.CLICK, function(e:MouseEvent){
ExternalInterface.call("gotoPage",3);
});

I can see from the javascript debugger that it is calling the function, but then acrobat crashes...

any help would be appreciated...
thanks

joshcorey
Registered: Jul 14 2008
Posts: 79
This is an issue we are aware of and we're working on it.
There is a workaround in the meantime. Take a look at this blog: http://blogs.adobe.com/pdfdevjunkie/2008/09/how_do_you_close_a_floating_ri.php
He was working a similar issue, trying to close an annotation in a floating window from a button in a SWF. Try taking the code snippet from the blog I pasted below and replace “rm = this.getAnnotsRichMedia(0)[0]; rm.activated=false;” with the Javascript call you want.

ExternalInterface.call( "eval", "app.setTimeOut('rm = this.getAnnotsRichMedia(0)[0]; rm.activated=false;',250);");
eidosk
Registered: Oct 1 2008
Posts: 4
that worked!
thanks a lot for your help josh

I have swfs in all my pages and they are enabled when the page is opened, so another thing I had to to avoid crashing acrobat was deactivating the swf in the current page before changing it.

here's is my code in case someone has my same problem.
actionscript in flash:
var strJS = "app.setTimeOut(\"gotoPage("+ _page + ")\",250)";ExternalInterface.call("eval",strJS);

javascript inside the pdf:
/*********** belongs to: Document-Level:gotoPage() ***********/function gotoPage(page){this.getAnnotsRichMedia(this.pageNum)[0].activated = false;this.pageNum = page;}