Attaching a mc u created in as?

so i’ve done 2 little versions of a simple program,
4 little rectangle are the corners of a bigger rectangle, which is been drawn per as.
so the first version is most simple:
the 4 little rectangles are on stage, every one is an own mc.
the second one :
one little rectangle is in the library and gets attached 4 times
the third one(my problem):
i want to create an rectangle via line.To etc. in an “this.createEmptyMovieClip” and then attach this one, but i can’t

here is how far i got

this.createEmptyMovieClip(“square”);
this.square.beginFill(0xffaa00, 30);
this.square.lineStyle(1,0x00ff00,100);
this.square.lineTo(10,0);
this.square.lineTo(10,10);
this.square.lineTo(0,10);
this.square.lineTo(0,0);
this.square.endFill();

this.attachMovie(this.square, “s_1”, 200);
this.attachMovie(this.square, “s_2”, 201);
this.attachMovie(this.square, “s_3”, 202);
this.attachMovie(this.square, “s_4”, 203);
this.onLoad = function() {
this.s_1._x = 50;
this.s_1._y = 50;
this.s_2._x = 100;
this.s_2._y = 50;
this.s_3._x = 100;
this.s_3._y = 100;
this.s_4._x = 50;
this.s_4._y = 100;
};
this.onEnterFrame = function() {
_root.s_1.onPress = function() {
this.startDrag();
};
_root.s_1.onRelease = function() {
this.stopDrag();
};
_root.s_2.onPress = function() {
this.startDrag();
};
_root.s_2.onRelease = function() {
this.stopDrag();
};
_root.s_3.onPress = function() {
this.startDrag();
};
_root.s_3.onRelease = function() {
this.stopDrag();
};
_root.s_4.onPress = function() {
this.startDrag();
};
_root.s_4.onRelease = function() {
this.stopDrag();
};
var x1:Number = _root.s_1._x;
var x2:Number = _root.s_2._x;
var x3:Number = _root.s_3._x;
var x4:Number = _root.s_4._x;
var y1:Number = _root.s_1._y;
var y2:Number = _root.s_2._y;
var y3:Number = _root.s_3._y;
var y4:Number = _root.s_4._y;
this.createEmptyMovieClip(“triangle_mc”, -1000);
triangle_mc.beginFill(0xff0000, 30);
triangle_mc.lineStyle(0.25, 0xff0000, 100);
triangle_mc.moveTo(x4, y4);
triangle_mc.lineTo(x1, y4);
triangle_mc.lineTo(x1, y1);
triangle_mc.lineStyle(1, 0x000000, 100);
triangle_mc.moveTo(x1, y1);
triangle_mc.lineTo(x4, y4);
triangle_mc.endFill();
triangle_mc.beginFill(0xff0000, 30);
triangle_mc.lineStyle(0.25, 0xff0000, 100);
triangle_mc.moveTo(x4, y4);
triangle_mc.lineTo(x4, y3);
triangle_mc.lineTo(x3, y3);
triangle_mc.lineStyle(1, 0x000000, 100);
triangle_mc.moveTo(x4, y4);
triangle_mc.lineTo(x3, y3);
triangle_mc.endFill();
triangle_mc.beginFill(0xff0000, 30);
triangle_mc.lineStyle(0.25, 0xff0000, 100);
triangle_mc.moveTo(x2, y2);
triangle_mc.lineTo(x3, y2);
triangle_mc.lineTo(x3, y3);
triangle_mc.lineStyle(1, 0x000000, 100);
triangle_mc.moveTo(x2, y2);
triangle_mc.lineTo(x3, y3);
triangle_mc.endFill();
triangle_mc.beginFill(0xff0000, 30);
triangle_mc.lineStyle(0.25, 0xff0000, 100);
triangle_mc.moveTo(x2, y2);
triangle_mc.lineTo(x1, y2);
triangle_mc.lineTo(x1, y1);
triangle_mc.lineStyle(1, 0x000000, 100);
triangle_mc.moveTo(x1, y1);
triangle_mc.lineTo(x2, y2);
triangle_mc.endFill();
var a4:Number = (x1-x4);
trace(“a4=”);
trace(a4);
var b4:Number = (y1-y4);
trace(“b4=”);
trace(b4);
var c4:Number = Math.sqrt(((a4)(a4)+(b4)(b4)));
trace(“c4=”);
trace(c4);
trace(“-------------------------------------------”);
var a1:Number = (x2-x1);
trace(“a1=”);
trace(a1);
var b1:Number = (y2-y1);
trace(“b1=”);
trace(b1);
var c1:Number = Math.round(Math.sqrt(((a1)(a1)+(b1)(b1))));
trace(“c1=”);
trace(c1);
trace(“-------------------------------------------”);
};