# Actionscript stroke and fill painting

**URL:** https://forum.kirupa.com/t/actionscript-stroke-and-fill-painting/564
**Category:** flash
**Created:** [July 22, 2002, 8:44pm UTC](https://forum.kirupa.com/t/actionscript-stroke-and-fill-painting/564 "2002-07-22T20:44:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Asterix](https://avatars.discourse-cdn.com/v4/letter/a/839c29/32.png) [@Asterix](https://forum.kirupa.com/u/Asterix)
#### Post date: [July 22, 2002, 8:44pm UTC](https://forum.kirupa.com/t/actionscript-stroke-and-fill-painting/564/1 "2002-07-22T20:44:47Z")

</div>

I have a vector shape of a country map that is a movieclip with only a black stroke color and a green fill color.

I want to change using **Actionscript** ONLY the fill color to another color.

I’ve tried to do it with the object properties (see example), but it paints all the map including the stroke path, and then I lost the black stroke.

// Method to paint  
Country.prototype.paint\_country = function(whichColor) {  
c = new Color(this);   
c.setRGB(parseInt(whichColor, 16));   
};

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 22, 2002, 8:46pm UTC](https://forum.kirupa.com/t/actionscript-stroke-and-fill-painting/564/2 "2002-07-22T20:46:15Z")

</div>

make another copy with just the stroke and put on the layer above. That way… your stroke will always be there.

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 22, 2002, 9:44pm UTC](https://forum.kirupa.com/t/actionscript-stroke-and-fill-painting/564/3 "2002-07-22T21:44:20Z")

</div>

I have 240 country shapes, so this will duplicate the size of the movie. ¿Do you have another idea?

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2002, 3:44am UTC](https://forum.kirupa.com/t/actionscript-stroke-and-fill-painting/564/4 "2002-07-23T03:44:02Z")

</div>

just a thought…

do you think its possible if you simply create a basic shape image and simply use a mask to get the shape you want …

think if this is possible…it will save a lot of resources overhead…

and you could simply paint the individual instance with actionscript…and retaining the stroke that is the mask…

hope it helps…no sure whether this is workable or not…:-\

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [July 23, 2002, 4:34am UTC](https://forum.kirupa.com/t/actionscript-stroke-and-fill-painting/564/5 "2002-07-23T04:34:46Z")

</div>

it will not duplicate size of the movie if you just use the pen tool to “trace” the stroke of your original movie.
