So kuckt mal bitte ob da alles Ok ist oder ob es wo zu Probleme kommen kann, ich hab das Gefühl es funktioniert.
Kann man es optimieren? Wo?
Ausserdem bekomm ich irgendwie net hin das der mir das Bild einfadet, daher noch das statsiche alpha=100, wie bekomm ich das hin?
ActionScript:
button._visible=false;
MovieClip.prototype.image = function (file,handler,hObj) {
pic = this.createEmptyMovieClip("img",1)
crt = this.createEmptyMovieClip("controll",2)
pic.loadMovie ("test.jpg")
crt.onEnterFrame = function () {
pic._visible = false
if (pic.getBytesLoaded() > 0 && pic.getBytesTotal() > 0) ready = int(pic.getBytesLoaded()*100/pic.getBytesTotal())
else ready = 0
createTextField("prozent",3,237,183,100,100)
prozent.autoSize = "left"
balken.removeMovieClip()
balken = createEmptyMovieClip("balken",10)
prozent.text = "Load_pic_"+ready+"_%"
var faktor = prozent._width/99
with (balken) {
_x = 237
_y = 200
lineStyle(2,0x999999,100)
moveTo (0,0)
lineTo (ready*faktor,0)
}
if (ready >= 99) {
rechteck.wabber(.5,pic._width+10,pic._height+10,.7);
if(rechteck._width-10==pic._width){
balken.removeMovieClip()
prozent.removeTextField();
pic._x=275-pic._width/2;
pic._y=200-pic._height/2;
button._x=275-pic._width/2-5;
button._y=200-pic._height/2-5;
button._visible=true;
pic._alpha=100;
pic._visible = true
if (index >2){
this.handlerObj = (!hObj) ? this._parent : hObj;
this.toHandel = handler;
this.handlerObj[this.toHandel](this);
delete index
delete crt.onEnterFrame
crt.removeMovieClip()
}
index++
}
}
}
}
MovieClip.prototype.wabber = function(multiplikator,xskal,yskal,ratio){
sX=Number(sX*multiplikator)+Number((xskal-rechteck._width)*ratio);
sY=Number(sY*multiplikator)+Number((yskal-rechteck._height)*ratio);
rechteck._width+=sX;
rechteck._height+=sY;
};