Uso il seguente preload nel primo frame del mio swf
_root.contenitore._visible=false;
_root.contenitore.loadMovie("./img/gallery/1.jpg");
_root.controllo.onEnterFrame=function()
{
_root.preload(_root.contenitore);
}
_root.preload=function(clip)
{
clip.stop();
car = clip.getBytesLoaded();
tot = clip.getBytesTotal();
perc = Math.round((car/tot)*100);
if(!isNaN(perc))
{
clip.testo.text = "Caricamento..."+perc+"%";
clip.testo.setTextFormat(testoformat);
}
if (car == tot && car > 1024)
{
_root.contenitore.swapDepths(1000);
clip.alpha1();
delete _root.controllo.onEnterFrame;
}
}
//per avere un effetto alfa
MovieClip.prototype.alpha1 = function ()
{
this._alpha = 0;
this._visible=true;
this.onEnterFrame = function ()
{
if (this._alpha<100)
{
this._alpha += 10;
}
}
}
Perché l'immagine mi compare solo dopo che eseguo un refresh della pagina?
Ecco il link di esempio: http://www.giannioliva.net/test/path.html