Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 14
  1. #1

    [2004] Dupplico MC che contiene un pulsante..

    sera,
    stasera mi perdo n'attimo!

    ho una MC con dentro pulsante.. dupplico con la seguente il tutto dando uno spazio alle mc:
    codice:
    for (i=0; i<7; i++) {
    	duplicateMovieClip(mc_btn, "mc_btn"+i, i+1);
    	this["mc_btn"+i]._y = this.mc_btn._y+(40*i);
    }
    ed ottengo a partire da "mc_btn0" le mie clip..
    ma anche altrettanti pulsanti a partire da "btn0" in poi..

    domanda..
    alle azioni dei pulsanti, che codeAS devo dare per far caricare ad ognuno un'immagine/swf diversa?

    i file esterni sono:
    image1, image2, image3, ecc...

    thanks
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    var images = ["immagine1.jpg", "immagine2.jpg", "immagine3.jpg"....];
    for (var i = 0; i < 7; i++) {
    	var mc = mc_btn.duplicateMovieClip("mc_btn" + i, i + 1);
    	mc._y = this.mc_btn._y + (40 * i);
    	mc.immagine = images[i];
    	mc.bottone.onRelease = function()
    	{
    		this._parent.funzione(this._parent.immagine);
    	}
    }

  3. #3
    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
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  4. #4
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Dove devi inserirla?

  5. #5
    Originariamente inviato da negatyve
    Dove devi inserirla?
    eccomi ho mangiato qualcosa..

    in pratica vorrei dare appunto l'effetto alle prime mc che creo sull'asse _y cioè le preview (che sono 4 )
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  6. #6
    UP..

    ci mancava pure il preload.. ovviamente così non le carica on-line
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  7. #7
    Uppettino..
    sono arenato!
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  8. #8
    nessuno che vuole aiutarmi ad implementare la function() espandi/contrai ??
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  9. #9
    forse..
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

  10. #10
    niente da fare..
    non riesco proprio ad ottenere l'effetto espandi/contrai!!
    sia con la versione che ho postato sopra che con una cominissima resizeMC qualsiasi.

    Spero che a qualcuno la cosa sia già capitata e che possa buttare l'okkio dentro al mio code.


    bye
    Interactive Html/CSS/JS Playground | @webbeloz ( cip..cip! )
    Mechanics & Expert Tuning Fix Z3 Roadster Community

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.