Ciao![]()
Ho questo codice che uso per caricare N immagini in una galleria
Il problema è che non riesco a far ridimensionare le immagini, perchè non entra mai nell'if dell'onEnterFrame della prima funzione.codice:function load_img() { for (k=0; k<Nrighe; k++) { for (i=1; i<=Nfile; i++) { img = "img/thumb_foto"+ID+".jpg" this.createEmptyMovieClip("box"+ID, ID); mc = this["box"+ID]; imagine_mc = mc.createEmptyMovieClip("cont_mc", 1); imagine_mc._x = 75*i; imagine_mc._y = (75*k)+50; imagine_mc.loadMovie(img); mc._alpha = 40; this.onEnterFrame = function() { if (imagine_mc.getBytesLoaded()>16 && imagine_mc.getBytesLoaded() == imagine_mc.getBytesTotal()) { dimensiona(imagine_mc._width, imagine_mc._height); delete this.onEnterFrame; } }; mc.onRelease = function() { var img_value = this._name.substring(3); carica(img_value); this._alpha = 100; pressed = true; }; mc.onRollOver = function(){ if(this._alpha != 100){ this._alpha = 99; pressed = false; } } mc.onRollOut = function(){ this.onEnterFrame = function(){ if(this._alpha < 100 && this._alpha > 40){ this._alpha -= 10; }else if(this._alpha == 100){ this._alpha == 100; delete this.onEnterFrame; }else{ this._alpha = 40; delete this.onEnterFrame; } } } ID++; if (ID == (Nfile*Nrighe+1)) { return false; } } } } .......... function dimensiona(larg, alt) { trace("ciao"); imagine_mc._xscale = Math.floor(5000/larg); imagine_mc._yscale = Math.floor(5000/alt); imagine_mc._alpha = 100; imagine_mc.onEnterFrame = function() { if (this._alpha<=100 && this._alpha > 50) { this._alpha -= 10; } else { this._alpha = 50; delete this.onEnterFrame; } }; } load_img();
Mi aiutate a risolvere il problema? Grazie![]()


Rispondi quotando