문제

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 ?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top