[Top][All Lists]

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

Re: [Swftools-common] search all text fields -> make buttons for urls

From: Matthias Kramm
Subject: Re: [Swftools-common] search all text fields -> make buttons for urls
Date: Fri, 26 Oct 2007 16:14:59 +0200
User-agent: Mutt/1.5.6i

On Wed, Oct 24, 2007 at 01:50:37AM +0100, Andreas M Eberharter wrote:
> I tried to search in the generated swf files for urls in the text field 
> and mark them with a button and attach them with an actionscript.
> Unfortunately I can't get this to work correctly.
> 1. I don't undersand how to organize the work flow in between the tools 
> and how to pass on the information: "swfdump -t | grep www" finds a lot 
> of links but how can I use this information with swfc ?

Use "swfdump -aup" instead of "swfdump -t". This lets you find all real
links, not just text with www in it.
For example:

[020]        35 DEFINESHAPE3 defines id 0007
                 | fillstyles(01)        linestyles(00)
                 | 1 ) SOLID ffffff40    
                 | fill: 01/00 line:00 - moveTo 0.00 0.00
                 | fill: 01/00 line:00 - moveTo 127.00 141.00
                 | fill: 01/00 line:00 - lineTo 182.00 141.00
                 | fill: 01/00 line:00 - lineTo 182.00 129.00
                 | fill: 01/00 line:00 - lineTo 127.00 129.00
                 | fill: 01/00 line:00 - lineTo 127.00 141.00
[007]        68 DEFINEBUTTON defines id 0005
                 (   36 bytes) action: GetUrl URL:"http://www.swftools.org"; 
                 (    0 bytes) action: End
                uses IDs: 6, 7, 7, 6
[01a]         5 PLACEOBJECT2 places id 0005 at depth 0004

In the above, find the "GetUrl" and the corresponding link "www.swftools.org".
Find out which ID this link belongs to (0005), and which IDs are used
by it (6, 7, 7, 6). From the latter, pick out one (7 in this example), and
find the ID 0007. Parse the shape information (the second moveTo, to 127/141,
is probably what you want for your button coordinates)

This, of course, is a horribly complex and cumbersome way to do things.
If you just need an Actionscript function to be called if a link is clicked,
use "pdf2swf -s externallinkfunction=myActionScriptFunction".

If you need rollovers, check out whether you can maybe extend lib/devices/swf.c
instead (one of the swfoutput_*link* functions).
All these functions call drawlink() with two ActionScript functions: One
for the mouse moving above the link, and one for the mouse moving away from the
(Thinking about it, an ActionScript function which is called for 
 for links is something which might be useful, anyway, so you might also want to
 add this as feature request to http://bugs.swftools.org)



reply via email to

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