non son riuscito ad usare il tuo metodo..
e mi son lanciato in una cosa + complicata che però funge bene.. adesso manca solo una cosa! la funzione espandi che non riesco ad inserirla ! :master:
quì la new:
codice:
//
image_arr = new Array("img/image0", "img/image1", "img/image2", "img/image3"); //, "image4", "image5", "image6", "image7");
currentHolder = 0;
theDepth = 1000;
_global.imageLoaded = false;
this.createEmptyMovieClip("img0_mc", theDepth+++10000);
this.createEmptyMovieClip("img1_mc", theDepth+++10000);
for (var i = 0; i<image_arr.length; i++) {
this.createEmptyMovieClip("thumb"+i+"_mc", theDepth++);
this.createEmptyMovieClip("thumb"+i+"_tmp_mc", theDepth++);
this["thumb"+i+"_mc"]._y = 10+70*i;
this["thumb"+i+"_mc"]._x = 10;
this["thumb"+i+"_mc"].loadMovie(image_arr[i]+"_tn.jpg");
this["thumb"+i+"_tmp_mc"].no = i;
this["thumb"+i+"_tmp_mc"].onEnterFrame = function() {
if (this._parent["thumb"+this.no+"_mc"]._width>1) {
this._parent["thumb"+this.no+"_mc"].num = this.no;
this._parent["thumb"+this.no+"_mc"].onPress = function() {
loadImage(this.num);
};
delete this.onEnterFrame;
this.removeMovieClip();
}
};
}
// *** function espandi mc ***
function loadImage(num) {
this["img"+currentHolder+"_mc"]._x = 150;
this["img"+currentHolder+"_mc"]._y = 1000;
this.createEmptyMovieClip("img0_tmp_mc", theDepth++);
this.createEmptyMovieClip("img1_tmp_mc", theDepth++);
this["img"+currentHolder+"_mc"].loadMovie(image_arr[num]+".swf");
this["img"+currentHolder+"_tmp_mc"].onEnterFrame = function() {
if (this._parent["img"+currentHolder+"_mc"]._width>1) {
this._parent["img"+currentHolder+"_mc"]._x = 40;
this._parent["img"+currentHolder+"_mc"]._y = 10;
this._parent["img"+currentHolder+"_mc"]._alpha = 1;
_global.imageLoaded = true;
delete this.onEnterFrame;
this.removeMovieClip();
}
};
this["img"+((currentHolder+1)%2)+"_tmp_mc"].onEnterFrame = function() {
if (_global.imageLoaded) {
if (this._parent["img"+currentHolder+"_mc"]._alpha<100) {
this._parent["img"+currentHolder+"_mc"]._alpha += 10;
this._parent["img"+((currentHolder+1)%2)+"_mc"]._alpha -= 10;
} else {
this._parent["img"+currentHolder+"_mc"]._alpha = 100;
this._parent["img"+((currentHolder+1)%2)+"_mc"]._alpha = 0;
currentHolder = (currentHolder+1)%2;
delete this.onEnterFrame;
this.removeMovieClip();
}
}
};
}
questa è la function() espandi:
codice:
function espandi() {
k = 0;
if (k<5) {
onEnterFrame = function () {
this["rett"+k].newys = 100;
k++;
};
}
}
function contrai() {
k = 6;
if (_root.rett6._yscale>98) {
onEnterFrame = function () {
if (k>=0) {
this["rett"+k].newys = 0;
k--;
}
};
}
}
_root.espandi()
dovrei inserirla nel codeAS sopra..
ciao
grazie