[AS3] beginFill and endFill weirdness

Ok so I’ve been working on this 3d engine in flash using AS3, and I got it to the point where I can have it render any set of points, be it an equation, or an array, to x, y, and z variables, and have it draw the correct lines in 3D. I also got it to the point where I can fill in said lines into shapes pretty easily.

Now, last night I decided that I kinda needed to render multiple objects at once. I split the actual points of the thing to draw into one function, and the rendering of said points into another. An array is used to collect the total points from each object to be rendered, and they are all collectively sent to be rendered at once.

However, when it goes to fill them in, something goes wrong, and I seem to be getting one extra triangle per item that shouldn’t exist. I really need this thing to work by like, tomorrow, and I’ve been scratching my head on this one for hours. Does anyone have any ideas?

Here’s the .fla: (you’ll probabbly have to right-click and hit Save As)
http://www.bulc.org/~onionringofdoom/coltrane7.fla

All the actionscript is on frame 341, and ignore any frames before that; they are just an intro to the movie I will be using my 3d engine in.

In the “Globals/Functions” layer, you will find, well, globals and a few random functions, along with the coordinates for each item to be rendered.

In the “Time” layer, you will find the function that uses the functions which plot and render the points.

In the “Red Ribbon” layer, you’ll find all the functions that actually do the plotting and rendering. The problematic fill stuff starts at line 98 in the “Red Ribbon” layer.

Everything is pretty clearly commented, but if you have any questions, feel free to ask. Any help is greatly appreciated!