metti un mc vuoto sullo stage e lo istanzi selezione
poi ticrei un mc contenitore che tieni in libreria e acui dai un nome linkage (concatenamento) "mc "
il movieclip linkato come "mc" al suo interno contiene
un mc_vuoto che va istanziato come "contenitore" puoi piazzare anche un campo di testo dinamico con nome var etichetta. olktre al mc_ vuoto
sul frame all'interno di "mc" il seguente codice
codice:
alpha=20
this.onRollOver = function() {
k=1;
}
this.onRollOut = function() {
k=0;
}
this.onEnterFrame = function() {
if (k==1 && this._alpha < 100) {
this._alpha += alpha;
}
if (k==0 && this._alpha > 50) {
this._alpha -= alpha;
}
}
this.onRelease = function () {
getURL("percorso","_blank")
_root.selezione.loadMovie(a);
// o cmq le tue azioni
}
questo sul frame della timeline principale
codice:
larghezzamovie = Stage.width;
posSin = 1;
vel = -5;
dimImm = 100;
selezione._y=150
letto = false;
leggi= function() {
nuovo = new XML();
nuovo.ignoreWhite = true;
nuovo.load("file.xml");
nuovo.onLoad= function (success) {
if (success) {
nfoto = this.childNodes.length;
posDes = nfoto;
for (i=0; i<nfoto; i++) {
_root.attachMovie("mc", "mc"+(i+1), i+1);
_root["mc"+(i+1)]._x = dimImm*i;
_root["mc"+(i+1)]._y = 20;
_root["mc"+(i+1)].etichetta.text = this.childNodes[i].attributes.descrizione;
_root["mc"+(i+1)].percorso.text = this.childNodes[i].attributes.percorso;
_root["mc"+(i+1)].a = this.childNodes[i].attributes.swf;
_root["mc"+(i+1)].contenitore.loadMovie(this.childNodes[i].attributes.photo);
_root["mc"+(i+1)]._alpha = 50;
}
letto = true;
} else {
_root.didascalia.text = "errore di lettura";
}
}}
leggi()
_root.onMouseMove = function() {
x = _root._xmouse;
y = _root._ymouse;
if (y>20 && y<120 && x>=0 && x<=larghezzamovie) {
vel = -(Math.round((x-(larghezzamovie/2))/10));
}
};
_root.onEnterFrame = function() {
if (letto ) {
for (i=1; i<=nfoto; i++) {
_root["mc"+i]._x += vel;
}
if (vel>0 && _root["mc"+posSin]._x>0) {
_root["mc"+posDes]._x = _root["mc"+posSin]._x-dimImm;
posSin = posDes;
posDes--;
if (posDes == 0) {
posDes = nfoto;
}
}
if (vel<0 && _root["mc"+posSin]._x<=-dimImm) {
_root["mc"+posSin]._x = _root["mc"+posDes]._x+dimImm;
posDes = posSin;
posSin++;
if (posSin>nfoto) {
posSin = 1;
}
}
}
};
questa invece la struttura del file xml
codice:
<foto photo="IMG01.jpg" descrizione="primafoto" percorso="http://www.4ward.it" swf=""></foto>
<foto photo="IMG02.jpg" descrizione="secondafoto" percorso="http://www.4ward.it" swf="photo.jpg"></foto>
<foto photo="IMG03.jpg" descrizione="terzafoto" percorso="http://www.4ward.it" swf="photo.jpg"></foto>
<foto photo="IMG04.jpg" descrizione="quartafoto" percorso="http://www.4ward.it" swf="photo.swf"></foto>
<foto photo="IMG05.jpg" descrizione="quintafoto" percorso="http://www.4ward.it" swf="photo.swf"></foto>
<foto photo="IMG06.jpg" descrizione="sestafoto" percorso="http://www.4ward.it" swf="photo.swf"></foto>
<foto photo="IMG07.jpg" descrizione="settimafoto" percorso="http://www.4ward.it" swf="photo.swf"></foto>
in questo caso le img stanno nella stessaa cartella del file swf e della pagina htm