salve ragazzi.
è la prima volta che uso l'as3, e il passaggio alla nuova versione degli actionscript sta diventando abbastanza traumatica...

tra i vari forum che ho consultato mi sono "incaponito" con questo codice e al momento riesco non a contattare colui il quale me lo ha suggerito...




[COLOR=orange-red]var imgArray:Array;
var imgMcArray:Array;
var counter:Number = 0;

init();
function init():Void
{
imgArray = [["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"],
["img.jpg", "http://www.google.it"], ["img.jpg", "http://www.google.it"]];

initImg();
}

function initImg():Void
{
imgMcArray = new Array();

for(var i:Number = 0; i<imgArray.length; i++)
{
var imgUrl:String = imgArray[i][0];
var imgMc:MovieClip = this.createEmptyMovieClip("img_" + i, i);
imgMcArray.push(imgMc);
caricaImg(imgUrl, imgMc);
}
}

function caricaImg(str:String, mc:MovieClip):Void
{
var mcl:MovieClipLoader = new MovieClipLoader();
var ls:Object = new Object();
ls.onLoadInit = imgLoaded;
mcl.addListener(ls);
mcl.loadClip(str, mc);
}

function imgLoaded(mc:MovieClip):Void
{
if(counter >= imgArray.length - 1)
{
counter = 0;
mostraImg();
}
else
{
counter++;
}
}

function mostraImg():Void
{
for(var i:Number = 0; i<imgMcArray.length; i++)
{
var imgMc:MovieClip = imgMcArray[i];
imgMc._x = Math.random() * 400;
imgMc._y = Math.random() * 900 - (imgMc._height / 2);
imgMc._alpha = Math.random() * 30 + 10;
imgMc.speed = Math.random() * 5 + 1;
imgMc.id = i;
imgMc.onEnterFrame = mover;
imgMc.onRelease = imgRelase;
}
}

function mover():Void
{
this._x += this.speed;
if(this._x >= 900)
{
this._y = Math.random() * 900 - (this._height / 2);
this._x = this._width * -1;
this._alpha = Math.random() * 30 + 10;
}
}

function imgRelase():Void
{
var url:String = imgArray[this.id][1];
getURL(url, "_blank");
}[/COLOR]


come potete vedere il codice crea delle immagini fluttuanti con un link associato.
funziona dapaura.

vorrei aggiungere al passaggio del mouse (rollover), alcuni effetti:
1) che l'immagine selezionata vada in primo piano
2) che si fermi il l'immagine selezionata.

Ho provato a fare esperimenti sul codice senza risultati (sintassi sgangherata? idee sbagliate? non so...)
Ragazzi se avete qualche idea sono a caccia di spunti e consigli.
Grazie!