Hello everybody
have a problem, maybe someone out there can help me...
I have a galery. It works fine. Now i want to add some FX when changing pictures. The problem is, the FX should start only when the picture has finished loading, so that the FX is visible.
On the main-timeline i have this code:
and on the Movieclip "bild_mc" i have this code:PHP Code:function ladeBild(paktBild) {
status_mc._visible = 1;
bild = bilder_theDataStore[paktBild].pic;
bildname = bilder_theDataStore[paktBild].name_;
titel_txt.text = bildname;
bild_mc._xscale = bild_mc._yscale=100;
//bild_mc._alpha = 100;
loadMovie(bild, "bild_mc");
this.onEnterFrame = function() {
if (bild_mc.getBytesLoaded()>=bild_mc.getBytesTotal() && bild_mc.getBytesLoaded()>12) {
delete this.onEnterFrame;
}
};
// When i put the below code here, the FX works, but it starts before the
// picture has finished loading... so no use putting it in here...
//new Tween(bild_mc, "_x", Bounce.easeOut, -100, 300, 1, true);
//new Tween(bild_mc, "_alpha", Strong.easeOut, 0, 100, 5, true);
I check the picture to be loaded, and then want to start the FX ... but the TWEEN does not start. is this because it is in a movieclip???PHP Code:onClipEvent (load) {
var i = 0;
}
onClipEvent (enterFrame) {
if (this._url != this._parent._url && !this.loaded)
{
var kilobytes = Math.ceil (this.getBytesTotal () / 1024);
var prozent = Math.ceil ((this.getBytesLoaded () / this.getBytesTotal ()) * 100);
this._parent.counter_txt.text = "Lade " + prozent + "% of " + kilobytes + "k";
this._parent.loading_txt.text = "Bild wird geladen - Bitte warten!";
this._parent.status_mc._width = prozent * 2;
if (prozent == 100)
{
i++;
// grosses bild bei bedarf anpassen START
if (this._width>_global.picmaxbreite) {
this._width = _global.picmaxbreite;
this._yscale = this._xscale;
}
// grosses bild bei bedarf anpassen ENDE
if (i == 15)
{
this.loaded = true;
this._parent.counter_txt.text = "";
this._parent.loading_txt.text = "";
this._parent.status_mc._visible = 0;
delete i;
trace ("finished loading..."); // this is displayed !
// I have here the FX, but it doesn't start/show ??!!
new Tween(this, "_x", Bounce.easeOut, -100, 300, 1, true);
new Tween(this, "_alpha", Strong.easeOut, 0, 100, 5, true);
//
}
}
}
}
Every help is appreciated...! Thanks in advance
Clark Kent





Bookmarks