views:

35

answers:

1

I've got a complicated shape in a MovieClip.
Runtime i want to change the stroke width of this Shape depending on a size ratio.

How can I change this property without redrawing the entire Shape with the drawing API (almost impossible, is a map with very detailed borders) ?

Is it possible ?

+3  A: 

It's tricky, but possible.

You can use as3swf to parse the shape, change the lineStyle record, publish it and read it back in to your master SWF. Flash Player 10 would be required for as3swf to work.

as3swf: http://github.com/claus/as3swf

Example: http://github.com/claus/as3swf/tree/master/examples/flexmania/ (see 4 - PublishModifiedLogo.fla)

You may want to reconsider redrawing the modified shape though. as3swf features export of shapes to GraphicsData, and Graphics.drawGraphicsData() is very fast.

Claus Wahlers
Holy crap batman, that's some nifty stuff you've got going there! Total upvote for ingenuity!
macke
heh.. thanks, macke!
Claus Wahlers
I was hoping for a native method. Of sure this class can solve my problem, but I'm astonished by the lack of this functionality so simple to set in Flash IDE
yuri