Originariamente inviato da rempox
codice:
onClipEvent (load)
{
    this.loadVariables("img/elenco_img.txt");
    _root.indietro._visible = 0;
}

onClipEvent (data)
{
    maxfoto = num_pic;
    trace(maxfoto);
    if (maxfoto < 1)
    {
        trace("non esistono foto");
    } // end if
    _root.pagine = Math.ceil(maxfoto / 8);
    _root.startpic = 1;
    _root.count = 0;
    for (j = 0; j < _root.pagine; j++)
    {
        for (k = 0; K <= 1; k++)
        {
            for (i = 0; i <= 3; i++)
            {
                _root.count++;
                nomeclip = "pic" + _root.count;
                this.createEmptyMovieClip(nomeclip, _root.count);
                this[nomeclip]._x = 100 * i + 400 * j;
                trace(this[nomeclip]._x);
                this[nomeclip]._y = K * 100;
                trace(this[nomeclip]._y);
            } // end of for
        } // end of for
    } // end of for
    for (l = 1; l <= maxfoto; l++)
    {
        immagine = "nomepic" + l;
        full = "img/" + eval(immagine)
        nomeclip = "pic" + l;
	this[nomeclip]._visible=0
        this[nomeclip].loadMovie(full);
        _root.preloadID = setInterval(_root.preload, 100);

	_root.box[nomeclip].onPress = function ()
        {
            var w = System.capabilities.screenResolutionX / 2;
            var h = System.capabilities.screenResolutionY / 2;
            var x = Math.round(w - larg / 2);
            var y = Math.round(h - alt / 2);
            getURL("javascript:window.open(\'" + full + "\',\'nName\',\'width=" + larg + ",height=" + alt + ",screenX=" + x + ",left=" + x + ",screenY=" + y + ",top=" + y + "," + feat + "\');void(0);", "");
        };
    } // end of for
}

onClipEvent (enterFrame)
{
    this.setMask(_root.mask);
}
prova così