I am trying to draw a box with ActionScript at runtime, but cannot get it to work. Here is the code I am using. Does anyone know why it is not working?


function drawBox(clip, color, alpha, lineType, x, y, w, h)
{
clip.lineStyle(lineType);
clip.beginFill(color,alpha);
clip.moveTo(x, y);
clip.lineTo(x+w, y);
clip.lineTo(x+w, y+h);
clip.lineTo(x, y+h);
clip.lineTo(x, y);
clip.endFill();
};


var myMC = _root.createEmptyMovieClip("myClip",1);

drawBox(myMC,0xDB3030,0xEEEEEE,1,20,30,100,30);