dunque, ridimensionare le foto... basta ricordarsi le proporzioni (non mi ricordo se prima o seconda media)
ho fatto questo scriptino, fa anche il preload, vedi un pò...
onClipEvent(load){
_parent.preload="loading... 0%";
destx=650;
desty=358;
}
onClipEvent(enterFrame){
caricati=this.getBytesLoaded();
tot=this.getBytesTotal();
percent=Math.ceil((caricati/tot)*100);
if(percent<100){
_parent.preload="loading... "+percent+"%";
}else{
_parent.preload="";
}
}
onClipEvent(data){
larghezza=this._width;
altezza=this._height;
if(larghezza > destx or altezza > desty){
if(larghezza>altezza){
newlarg=destx;
newalt=(destx*altezza)/larghezza;
//se, riscalata, comunque non ci sta
if(newalt>desty){
newlarg=(newlarg*desty)/newalt;
newalt=desty;
}
this._width=newlarg;
this._height=newalt;
}else if(altezza>=larghezza){
newalt=desty;
newlarg=(desty*larghezza)/altezza;
this._width=newlarg;
this._height=newalt;
}
this._x=this._x-(newlarg/2);
this._y=this._y-(newalt/2);
}else{
//se non necessita di riscalatura
this._x=this._x-(larghezza/2);
this._y=this._y-(altezza/2);
}
}

)
Rispondi quotando