# Filling withing a dynamic boundary

**URL:** <https://forum.kirupa.com/t/filling-withing-a-dynamic-boundary/240690>\
**Category:** flash\
**Created:** [October 5, 2007, 2:17am UTC](https://forum.kirupa.com/t/filling-withing-a-dynamic-boundary/240690 "2007-10-05T02:17:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nutcase88](https://avatars.discourse-cdn.com/v4/letter/n/f19dbf/32.png) [@nutcase88](https://forum.kirupa.com/u/nutcase88)\
**Post date:** [October 5, 2007, 2:17am UTC](https://forum.kirupa.com/t/filling-withing-a-dynamic-boundary/240690/1 "2007-10-05T02:17:25Z")

</div>

Hi i am currently working on a flash program that requires me to fill up spaces that have been set by a boundary.

Ok scrape that first post, now that im using lineTo and moveTo, i need some assistance in using beginFill.

A portion of my code are as follow.

```auto
        name = "line"+number_line;
        mc0 = _root.createEmptyMovieClip(name, number_line);
        mc0.lineStyle(1, 0x1919B3, 100);
        for (var i = 0; i<arrayPos; i++) {
            if (xArray[i+1] != undefined || xArray[i+1] != null) {
                origin_x = xArray*;
                origin_y = yArray*;

                mc0.moveTo(origin_x, origin_y);
                mc0.lineTo(xArray[i+1], yArray[i+1]);
            }
        }

```

I have stored the line positions in an array (xArray, y Array) and am using a for loop to run and draw the image. Now the problem is that beginFill doesnt not work due the the fact that i have to keep updating the starting position of the next line.

Any ideas?

Thanks for your help in adv.
