View Full Version : changing shape (already drawn) strokes?
jng
January 5th, 2009, 10:53 AM
The stroke property of a shape is clearly different from the fill property and I see that on the stage and can change each property via the properties panel when the shape is on the stage. But how do I do this via actionscript?
I've got a map with states and each state is SHAPE with a fill and a 1pt stroke. Depending on data I want to change the fill color of the states but NOT the stroke. Right now, the whole thing changes. Any ideas?
ayumilove
January 5th, 2009, 11:13 AM
one simple method.
create a new layer with the stroke only, the fill is removed.
This layer is place above your state.
jng
January 5th, 2009, 01:42 PM
I was dreading that answer because how I've got it imported from Illustrator has each state/shape with it's own stroke.
There's no way to draw a border around a polygon in AS3?
theCodeBot
January 5th, 2009, 03:49 PM
What you cannot do: Edit existing drawn strokes.
What you can do: Draw them using code, and store what you did. Then you can change the list of what you did and have it redraw that (effectively editing the original drawing). I believe Senocular made a class that does exactly that, and rather nicely too.
Senocular correct me if I'm wrong, but I think it's this one (http://www.senocular.com/flash/actionscript.php?file=ActionScript_3.0/com/senocular/display/GraphicsCopy.as)
TheCanadian
January 5th, 2009, 03:54 PM
I don't really understand your problem, but why can't you just edit it in Illustrator?
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.