John Francis Lee пишет:
Matthias Kramm wrote:
On Sun, Mar 15, 2009 at 08:56:19PM +0200, Max <[email protected]>
wrote:
pdf2swf -f -T9 -s linkfunction=event -B test.swf file.pdf -o result.swf
But it doesn't work (without viewer links works fine). I can't
understand what's wrong ?
The problem is with swfcombining the two Flash 9 SWFs- only the
ActionScript in your viewer is executed, however for the links to
generate Events the ActionScript portion of the converted file
needs to be executed, too. This is a bug in swfcombine.
Try loading the converted file dynamically from your viewer for now,
then it should work.
Can you give an example of "loading the converted file dynamically
from your viewer"? I think that would solve my problems too.
Greetings
Matthias
var viewport:MovieClip;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
loader_completeHandler);
loader.load(new URLRequest("file.swf"));
function loader_completeHandler(event:Event):void {
viewport = loader.content as MovieClip;
//viewport.stop();
viewport.gotoAndStop(5);
viewport.addEventListener("link", viewport_linkHandler);
addChild(viewport);
}
function viewport_linkHandler(event:TextEvent):void {
throw new Event(event.text);
}
Convert PDF using
pdf2swf -f -T9 -s linkfunction=event file.pdf -o file.swf
Works fine, but i need one swf file =(