[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] Handling "link" event

From: Max
Subject: Re: [Swftools-common] Handling "link" event
Date: Mon, 16 Mar 2009 23:26:21 +0200
User-agent: Thunderbird (Windows/20081209)

John Francis Lee пишет:
Matthias Kramm wrote:
On Sun, Mar 15, 2009 at 08:56:19PM +0200, Max <address@hidden> 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.



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.addEventListener("link", viewport_linkHandler);

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 =(

reply via email to

[Prev in Thread] Current Thread [Next in Thread]