# beginFill () endFill ()

**URL:** https://forum.kirupa.com/t/beginfill-endfill/1769
**Category:** flash
**Created:** [May 27, 2002, 8:42pm UTC](https://forum.kirupa.com/t/beginfill-endfill/1769 "2002-05-27T20:42:14Z")
**Posts on this page:** 4
**Page:** 1

<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: [May 27, 2002, 8:42pm UTC](https://forum.kirupa.com/t/beginfill-endfill/1769/1 "2002-05-27T20:42:14Z")

</div>

In my tutorial about drawing in MX here : [www.kirupa.com/developer/…gboard.asp](http://www.kirupa.com/developer/actionscript/drawingboard.asp) , I tried to make forms with a fill, but couldn’t. What I did was the following (look at the code) :

```auto
 _root.onMouseDown = function(){
&nbsp &nbsp &nbsp &nbsp line.beginFill (0xFF0000) ;
// etc...

and then :
_root.onMouseUp = function(){
&nbsp &nbsp &nbsp &nbsp line.endFill () ;
// etc...

```

It doesn’t work (actually it does some interesting things if you press long enough…).

Any ideas ??

pom 0]

---

<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: [May 27, 2002, 9:25pm UTC](https://forum.kirupa.com/t/beginfill-endfill/1769/2 "2002-05-27T21:25:06Z")

</div>

// paste this post into a one frame empty fla:  
\_root.createEmptyMovieClip(“line”, 1);  
\_root.aHolder = [];  
this.onMouseDown = function() {  
line.Xstart = \_xmouse;  
line.Ystart = \_ymouse;  
line.lineStyle(2, 0x000000, 100);  
line.moveTo(\_xmouse, \_ymouse);  
this.onMouseMove = function() {  
\_root.aPos = [\_xmouse, \_ymouse];  
\_root.aHolder.unshift(\_root.aPos);  
line.lineTo(\_root.aPos[0] , \_root.aPos[1]);  
updateAfterEvent();  
};  
};  
\_root.onMouseUp = function() {  
line.lineTo(line.Xstart, line.Ystart);  
fDrawFilled(\_root.aHolder);  
this.onMouseMove = null;  
\_root.aHolder = [];  
};  
function fDrawFilled(aArray) {  
aTemp = [];  
aTemp = aTemp.concat(aArray);  
line.clear();  
line.lineStyle(2, 0x000000, 100);  
line.beginFill(0x00ff00, 100);  
line.moveTo(aTemp[0] [0] , aTemp[0] [1]);  
for (ii=1; ii\<aTemp.length; ii++) {  
line.lineTo(aTemp[ii][0] , aTemp[ii][1]);  
}  
line.endFill();  
}

// clears the screen when you release the mouse, but that’s not necessary.  
// 🙂  
// jeremy

---

<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: [May 27, 2002, 10:39pm UTC](https://forum.kirupa.com/t/beginfill-endfill/1769/3 "2002-05-27T22:39:47Z")

</div>

Thanks Sinf, I’ll have to check that.

By the way, I edited your post because there were 0] all around your arrays. Darn Ezboard.

pom 0]

---

<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: [May 28, 2002, 2:34am UTC](https://forum.kirupa.com/t/beginfill-endfill/1769/4 "2002-05-28T02:34:18Z")

</div>

thanks, i must have forgotten to turn all those fun things off.  
🙂  
jeremy
