Lucero
27.05.2006, 13:43
Подскажите, пожалуйста, почему при компиляции выдаются ошибки? По идее, здесь должно получиться добавление движения на примере скольжения уголков на свои места. При запуске ролика углы постепенно появляются и скользят на свои позиции каждый раз при изменении размеров окна браузера или проигрывателя Flash.
fscommand("allowscale", "false");
Stage.scaleMode="showAll";
Stage.originalWidth=Stage.Width;
Stage.originalHeight=Stage.Height;
Stage.scaleMode="noScale"
Stage.onResize=function(){
this.left=this.getLeft();
this.top=this.getTop();
this.right=this.getRight();
this.bottom=this.getBottom();
};
Stage.getLeft=function(){
return-1*(this.width-this.originalWidth)/2;
};
Stage.getTop=function(){
return-1*(this.height-this.originalHeight)/2;
};
Stage.getRight=function(){
return this.left+this.width;
};
Stage.getBottom=function(){
return this.top+this.height;
};
Stage.addListener(Stage);
Stage.addListener(tl);
Stage.addListener(tr);
Stage.addListener(bl);
Stage.addListener(br);
MovieClip.prototype.slideTo=function(x, y, speed, callbackObj, callbackFunc){
var noo
if (this.slideControl){
noo=this.slideControl;
}else{
noo=this.createEmptyMovieClip("slideControl",this.depth++);
}
noo.tx=x;
noo.ty=y;
noo.speed=speed;
noo.callBackObj=callBackObj;
noo.callBackFunc=callBackFunc;
noo.onEnterFrame=function(){
this._parent._x+=(this.tx-this._parent._x)/this.speed;
this._parent._y+=(this.ty-this._parent._y)/this.speed;
if(Math.abs(this.tx-this._parent._x)<0.2&&Math.abs(this.ty-this._parent._y)<0.2){
this._parent._x=this.tx;
this._parent._y=this.ty;
this.callBackObj [this.callBackFunc] (this._parent);
this.removeMovieClip();
}
};
};
tl.onResize=function(){
var x=Stage.left;
var y=Stage.top;
this.slideTo(x,y,5);
};
tr.onResize=function(){
var x=Stage.right-this._width;
var y=Stage.top;
this.slideTo(x,y,5);
};
bl.onResize=function(){
var x=Stage.left;
var y=Stage.bottom-this._height;
this.slideTo(x,y,5);
};
br.onResize=function(){
var x=Stage.right-this._width;
var y=Stage.bottom-this._height;
this.slideTo(x,y,5);
};
fscommand("allowscale", "false");
Stage.scaleMode="showAll";
Stage.originalWidth=Stage.Width;
Stage.originalHeight=Stage.Height;
Stage.scaleMode="noScale"
Stage.onResize=function(){
this.left=this.getLeft();
this.top=this.getTop();
this.right=this.getRight();
this.bottom=this.getBottom();
};
Stage.getLeft=function(){
return-1*(this.width-this.originalWidth)/2;
};
Stage.getTop=function(){
return-1*(this.height-this.originalHeight)/2;
};
Stage.getRight=function(){
return this.left+this.width;
};
Stage.getBottom=function(){
return this.top+this.height;
};
Stage.addListener(Stage);
Stage.addListener(tl);
Stage.addListener(tr);
Stage.addListener(bl);
Stage.addListener(br);
MovieClip.prototype.slideTo=function(x, y, speed, callbackObj, callbackFunc){
var noo
if (this.slideControl){
noo=this.slideControl;
}else{
noo=this.createEmptyMovieClip("slideControl",this.depth++);
}
noo.tx=x;
noo.ty=y;
noo.speed=speed;
noo.callBackObj=callBackObj;
noo.callBackFunc=callBackFunc;
noo.onEnterFrame=function(){
this._parent._x+=(this.tx-this._parent._x)/this.speed;
this._parent._y+=(this.ty-this._parent._y)/this.speed;
if(Math.abs(this.tx-this._parent._x)<0.2&&Math.abs(this.ty-this._parent._y)<0.2){
this._parent._x=this.tx;
this._parent._y=this.ty;
this.callBackObj [this.callBackFunc] (this._parent);
this.removeMovieClip();
}
};
};
tl.onResize=function(){
var x=Stage.left;
var y=Stage.top;
this.slideTo(x,y,5);
};
tr.onResize=function(){
var x=Stage.right-this._width;
var y=Stage.top;
this.slideTo(x,y,5);
};
bl.onResize=function(){
var x=Stage.left;
var y=Stage.bottom-this._height;
this.slideTo(x,y,5);
};
br.onResize=function(){
var x=Stage.right-this._width;
var y=Stage.bottom-this._height;
this.slideTo(x,y,5);
};