}
//----------------------------------------------------------------------------
public void drawObject(Movie movie, int layer, int speed)
{
Frame frame;
Shape line_shape;
AlphaColor alpha_color;
int draw_points = speed + 1;
Point[] point = new Point[draw_points];
Instance instance;
if ( points_.size() > 0 )
{
alpha_color = new AlphaColor( pen_color_.getRed(), pen_color_.getGreen(), pen_color_.getBlue(), pen_color_.getAlpha() );
point[0] = (Point) points_.get(0);
// draw all points with stepsize speed
for (int count = 1; count < points_.size(); count += speed)
{
line_shape = new Shape();
line_shape.defineLineStyle(stroke_.getLineWidth(), alpha_color);
line_shape.setLineStyle(1);
line_shape.move(point[0].x, point[0].y);
// draw points for this step ( amount of points = speed + 1 = draw_points )
for (int point_count = 1; point_count < draw_points; point_count++ )
{
if (count + point_count < points_.size())
{
point[point_count] = (Point) points_.get(count + point_count);
line_shape.line(point[point_count].x, point[point_count].y);
}
}
// draw it into a new frame of SWF
frame = movie.appendFrame();
frame.placeSymbol(line_shape, 0, 0);
// the startpoint of next step is our last point.
point[0] = point[draw_points - 1];
}
}