Tutorials, extensions, and source files for ActionScript, Flash, and other Adobe products.

 

senocular.com ActionScript Library

line.as

1
2
3
4
5
6
7
8
9
_global.line = function(mc, x,y, w,h, lstyle, fstyle){
	// lstyle and fstyle are arrays of lineStyle and beginFill arguments respectively
	if (lstyle) mc.lineStyle.apply(mc, lstyle);
	if (fstyle) mc.beginFill.apply(mc, fstyle);
	mc.moveTo(x, y);
	mc.lineTo(x+w, y+h);
	if (fstyle) mc.endFill();
	return mc;
};