Put it at 1st frames. Enjoy!
Code:
========================================================== =
Stop ();
VaR rect1: movieclip = createrectangle1 (150, 3, 0x000000 );
VaR rect2: movieclip = createrectangle2 (152, 5, 0x000000 );
Rect1. _ x = (stage. Width-rect1. _ width)/2;
Rect1. _ y = (stage. Height-rect1. _ height)/2;
Rect2. _ x = (stage. Width-rect2. _ width)/2;
Rect2. _ y = (stage. Height-rect2. _ height)/2;
Onenterframe = function (){
Rect1. _ width = _ root. getbytesloaded ()/_ root. getbytestotal () * 150;
If (_ root. getbytesloaded () = _ root. getbytestotal ()){
Rect1.removemovieclip ();
Rect2.removemovieclip ();
Delete rect1;
Delete rect2;
Delete createrectangle1;
Delete createrectangle2;
Delete onenterframe;
Play ();
}
};
Function createrectangle1 (width: Number, height: Number, color: number, scope: movieclip): movieclip {
Scope = (scope = undefined )? This: scope;
VaR depth: Number = scope. getnexthighestdepth ();
VaR MC: movieclip = scope. createemptymovieclip ("MC _" + depth, depth );
MC. beginfill (color );
MC. lineto (0, height );
MC. lineto (width, height );
MC. lineto (width, 0 );
MC. lineto (0, 0 );
Return MC;
}
Function createrectangle2 (width: Number, height: Number, color: number, scope: movieclip): movieclip {
Scope = (scope = undefined )? This: scope;
VaR depth: Number = scope. getnexthighestdepth ();
VaR MC: movieclip = scope. createemptymovieclip ("MC _" + depth, depth );
MC. linestyle (color );
MC. moveTo (0, 0 );
MC. lineto (0, height );
MC. lineto (width, height );
MC. lineto (width, 0 );
MC. lineto (0, 0 );
Return MC;
}
========================================================== =