I'm not sure if this is the appropriate place to ask, but then again I'm not exactly sure where my problem is...I know it's a ridiculously easy problem to fix, but I just haven't seen it yet.
~ OK, the background:
I'm learning how build a rich media PDF. I'm building the most basic pdf i can with a simple Flash button to advance the page. I'm missing something very basic because I can't get it to work.
~ The goal:
I simply want to understand the interaction between AS3 and Javascript, get the most simple example of it working that I can make, and then learn/build/play from there.
~ The files/elements:
A simple 10 page pdf, exported from InDesign cs4, that is totally blank save for simple page numbers manually inserted via text fields.
A plain flash button, consisting of nothing more than a rectangular primitive, converted to a movie clip, with some simple AS3 in it. No up/over/down states involved or called for, just a simple box with no animation whatsoever.
~ The API...and I'm guessing my problem:
OK, the Flash 'button' is embedded in the pdf itself via the Flash Media tool, and the code is as follows...
Flash AS3 -
function fClick(e:MouseEvent):void
{
ExternalInterface.call("turnNext");
}
redsquare.addEventListener(MouseEvent.CLICK,fClick);
And the JavaScript that receives that command sits at the document level and reads -
function turnNext()
{this.pageNum++;
}
I open it in either Acrobat or Reader, the pages advance manually via the menu bar just fine...but if I click that Flash button? The taskbar indicates the page number advanced to page 2, the page itself never leaves page 1 though (like it gets hung up mid page-turn), the whole thing freezes and boots the Acrobat or Reader right on the spot.
I can't see how I could make it more simple, and yet I'm still missing it. The code itself 'this.pageNum++;' works fine in the Javascript Debugger, advances the pages as it should...I don't get it. What am I missing?
I'd be eternally grateful if someone would point out what I'm sure is a simple oversight on this!
Thank you VERY much...LM
The JavaScript works fine in the JavaScript Debugger, and it's sitting at the document level where it can 'hear' the AS3.0 pass it a command.
There are literally no other elements in the entire thing to interfere with it...heck, I've only got the button on one page. I'm only trying to turn it to page 2 and leave it at that.
Is it some kind of global setting for the pdf that I missed?
/compared to this, running a reactor on an aircraft carrier was EASY...
“Courage is going from failure to failure without losing enthusiasm.”
~ Winston Churchill