Вложений: 1
Ну мне до вас еще далеко :) Но все же:
Код:
drawSquare = function(x1,y1,x2,y2:Number,Num:String){
this.createEmptyMovieClip("square"+Num,this.getNextHighestDepth());
with(_root["square"+Num]){
beginFill("0x000000",70);
moveTo(x1,y1);
lineTo(x2,y1);
lineTo(x2,y2);
lineTo(x1,y2);
lineTo(x1,y1);
endFill();
_root["square"+Num]._x = 0;
}
}
drawSquare(100,100,130,130,1);
_root.square1.onMouseDown = function(){
if(this.hitTest(_xmouse,_ymouse,false)){
startDrag(this,false,0,_y,100,_y);
}
}
_root.square1.onMouseUp = function(){
this.stopDrag();
}
drawBorderLine = function(){
this.createEmptyMovieClip("line",this.getNextHighestDepth());
with(_root.line){
lineStyle(2,0xCCCCCC);
moveTo(230,100);
lineTo(230,130);
moveTo(100,100);
lineTo(100,130);
}
}
nx = 0;
drawSquare(100,110,230,120,2);
this.createTextField("percent",this.getNextHighestDepth(),165,105,35,50);
_root.percent.textColor = 0xFFFFFF;
_root.square1.onMouseMove = function(){
nx = _root.square1._x;
_root.percent.text = nx + "%";
}
drawBorderLine();
drawBorder = function(){
maxx = Stage.width;
maxy = Stage.height;
this.createEmptyMovieClip("stageBorder",this.getNextHighestDepth());
with(_root.stageBorder){
lineStyle(2,0x000000);
moveTo(0,0);
lineTo(maxx,0);
lineTo(maxx,maxy);
lineTo(0,maxy);
lineTo(0,0);
}
}
drawBorder();
|