# Problem with beginFill() endFill()

**URL:** https://forum.kirupa.com/t/problem-with-beginfill-endfill/281778
**Category:** flash
**Created:** [February 13, 2009, 4:27am UTC](https://forum.kirupa.com/t/problem-with-beginfill-endfill/281778 "2009-02-13T04:27:03Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![hailflex](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@hailflex](https://forum.kirupa.com/u/hailflex)
#### Post date: [February 13, 2009, 4:27am UTC](https://forum.kirupa.com/t/problem-with-beginfill-endfill/281778/1 "2009-02-13T04:27:03Z")

</div>

Hello, I’m using **beginFill()** e \*\*endFill() \*\*in 2 parts of the program, one works and the other doesn’t

```auto
menubg.bg.beginFill(0x7ABB30);
menubg.bg.moveTo(0,0);
menubg.bg.lineTo(0,itens*(bttnHeight+_root.BttnDist) - _root.BttnDist);
menubg.bg.lineTo(20,itens*(bttnHeight+_root.BttnDist) - _root.BttnDist);
menubg.bg.lineTo(20,0);
menubg.bg.lineTo(0,0);
menubg.bg.endFill();    

button_mc.bttn.inner_bttn.bg.beginFill(0x7ABB30);
button_mc.bttn.inner_bttn.bg.moveTo(0,0);
button_mc.bttn.inner_bttn.bg.lineTo(0,bttnHeight);
button_mc.bttn.inner_bttn.bg.lineTo(bttnWidth,bttnHeight);
button_mc.bttn.inner_bttn.bg.lineTo(bttnWidth,0);
button_mc.bttn.inner_bttn.bg.lineTo(0,0);
button_mc.bttn.inner_bttn.bg.endFill();

```

The problem is when i draw a rectangle in the MovieClip **button\_mc.bttn.inner\_bttn.bg** , it appears (the rect) in the screen, but the **onRollOver** event that is in\*\* button\_mc.bttn\*\* doesn’t identify the rectangle, just the text that is loaded dynamicaly in **button\_mc.bttn.inner\_bttn.txt**

Also when i use **button\_mc.bttn.duplicateMovieClip(“bttn”+i, i);** it duplicates the text, but not the background (the rect drawn by **beginFill() endFill()**)

In the other side, the rectangle that was drawn in **menubg.bg** works normaly, it’s \*\*onRollOver \*\*recognizes the background and not just text…

If i make a rectangle manually inside flash (as a graphic or whatever) without using **beginFill() endFill()**, everything works perfectly (both **onRollOver** and **duplicateMovieClip**.

Could anyone help me with this problem?? Thanks in advance
