swftools-common
[Top][All Lists]
Advanced

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

[Swftools-common] Re: calling actionscript 3 methods from pdf2swf links


From: Veli Ogla Sungutay
Subject: [Swftools-common] Re: calling actionscript 3 methods from pdf2swf links
Date: Thu, 11 Mar 2010 19:26:11 +0200


Got it. This gave it away and I made it work. The trick is to use a TextEvent added to the swf.

} else if(oldaction && oldaction->op == ACTION__GETURL) {
                    if(!events) {
                        __ findpropstrict(h,"flash.net::navigateToURL");
                        __ findpropstrict(h,"flash.net::URLRequest");
                        // TODO: target _blank
                        __ pushstring(h,(char*)oldaction->data); //url
                        __ constructprop(h,"flash.net::URLRequest", 1);
                        __ callpropvoid(h,"flash.net::navigateToURL", 1);
                    } else {
                        __ getlocal_0(h); //this
                        __ findpropstrict(h, "[package]flash.events::TextEvent");
                        __ pushstring(h, "link");
                        __ pushtrue(h);
                        __ pushtrue(h);
                        __ pushstring(h,(char*)oldaction->data); //url
                        __ constructprop(h,"[package]flash.events::TextEvent", 4);
                        __ callpropvoid(h,"[package]::dispatchEvent", 1);
                    }
                } else if(oldaction) {
                    fprintf(stderr, "Warning: Couldn't translate button code of button %d to flash 9 abc action\n", id);
                }



On Thu, Mar 11, 2010 at 4:47 PM, Veli Ogla Sungutay <address@hidden> wrote:
Hi Matthias,

I sent this message to the list but not CCed  you, so here it is. Will appreciate your feedback!!

In the documents I see that this calls an AS function:
http://pdf2swf:call:_root.myFunction:parameter

I use it like:
<a href="">http://pdf2swf:call:MainApp.staticMethod:parameter "></a>
But the link disappears. Without the http:// I can see the link, but browser tries to open a new window without triggering the callback.

Am I doing something wrong? Thanks!!

--
Veli Sungutay
http://www.lyciasoft.com



--
Veli Sungutay
http://www.lyciasoft.com

reply via email to

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