PDA

View Full Version : .swf format for clickregion


tertlstudo
09-18-2006, 01:27 PM
There has been some mention, in this forum and elsewhere, of the clickregion attribute that specifies which parts of a view respond to clicks and exhibit mouseover behavior. Evidently the required format is .swf.

I am using GraphicConverter to convert image files to .swf format. However, I can't get any of these files to have any impact on view behavior. Perhaps GraphicConverter's support of the format is incomplete?

In what way is the .swf supposed to represent the click region? Is the region, or its complement, indicated by black? white? transparent? How does one create an effective .swf, working on the Mac? Do I need to bite the bullet and buy Flash?

Thanks /c

jks_pdx
09-19-2006, 07:23 AM
You need to make a shape that defines the bounds of your clickable area. The tool I use is swfmill - It doesn't help any with getting the corrdinates right or anything, but it's a great open source swf generator.

swfmill takes an xml file and makes a swf file from it (or vice versa). Get it at: swfmill.org
Here's the xml for a simple oval shaped click region that we use:

<?xml version="1.0"?>
<swf version="7" compressed="0">
<Header framerate="12" frames="1">
<size>
<Rectangle left="0" right="3340" top="0" bottom="1720"/>
</size>
<tags>
<SetBackgroundColor>
<color>
<Color red="255" green="255" blue="255"/>
</color>
</SetBackgroundColor>
<DefineShape objectID="1">
<bounds>
<Rectangle left="10" right="3330" top="10" bottom="1710"/>
</bounds>
<styles>
<StyleList>
<fillStyles>
<Solid>
<color>
<Color red="102" green="255" blue="102"/>
</color>
</Solid>
</fillStyles>
<lineStyles>
<LineStyle width="20">
<color>
<Color red="0" green="0" blue="0"/>
</color>
</LineStyle>
</lineStyles>
</StyleList>
</styles>
<shapes>
<Shape>
<edges>
<ShapeSetup x="1670" y="1700" fillStyle1="1" lineStyle="1"/>
<CurveTo x1="-683" y1="0" x2="-484" y2="-246"/>
<CurveTo x1="-483" y1="-246" x2="0" y2="-348"/>
<CurveTo x1="0" y1="-348" x2="483" y2="-246"/>
<CurveTo x1="484" y1="-246" x2="683" y2="0"/>
<CurveTo x1="683" y1="0" x2="483" y2="246"/>
<CurveTo x1="484" y1="246" x2="0" y2="348"/>
<CurveTo x1="0" y1="348" x2="-484" y2="246"/>
<CurveTo x1="-483" y1="246" x2="-683" y2="0"/>
<ShapeSetup/>
</edges>
</Shape>
</shapes>
</DefineShape>
<PlaceObject2 replace="0" depth="1" objectID="1">
<transform>
<Transform transX="0" transY="0"/>
</transform>
</PlaceObject2>
<ShowFrame/>
<End/>
</tags>
</Header>
</swf>

tertlstudo
09-20-2006, 07:57 AM
Thanks! (again!)
Cheers /c