[swfmill] Why does swfmill produce extra unneeded definitions?
Daniel Cassidy
mail at danielcassidy.me.uk
Thu Jun 17 14:41:59 PDT 2010
Hi Armencho,
On 17 June 2010 20:49, armencho at gmail.com <armencho at gmail.com> wrote:
> Thanks Dan. Yes, it appears that it is what is going on. A bit strange
> though in my case, because i have a very simple svg that simply draws an
> "arrow" as a polygon with three vertices:
>
> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
> <svg xmlns="http://www.w3.org/2000/svg">
> <polygon fill="black" points="-5,-2.5 5,-2.5 0,2.5" />
> </svg>
>
> So, in the case above, there is no distinct sprite child to manipulate.
>
> But swfmill still generates a Sprite that contains a Sprite (with runtime
> property referencing it) that contains the actual shape graphics. And since
> it generates a property with random name like "id*******" (7 random digits
> for asterisks), it is also difficult to write a class definition in say haXe
> that will match the graphics.
>
> I am not sure what exactly is going on...
>
> But I can leave it be because I typed my class as "dynamic" meaning that
> the extra property is not a problem now and can be added at runtime.
>
If you give the sprite an id in the SVG, then that id will be used as the
name of the property.
<polygon id="foo" fill="black" points="-5,-2.5 5,2.5 0,2.5"/>
You can then write a class with the appropriate property name and you don’t
need to make it dynamic.
class Arrow extends Sprite {
var foo :Sprite;
}
Hope this helps,
Dan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://osflash.org/pipermail/swfmill_osflash.org/attachments/20100617/058545f4/attachment.html>
More information about the swfmill
mailing list