Visualizzazione dei risultati da 1 a 4 su 4

Discussione: far ciclare un filmato

  1. #1

    Voglio far ciclare un filmato ma nn riesco! AIUTO!!!

    Ciau a tutti,

    posto questa rikiesta di aiuto xké dopo aver scaricato QUESTO filmato, l'ho modificato in alcune caratteristiche, tipo immagine di sfondo, testo visualizzato, ecc... ecc...

    Nel filmato è previsto ke venga eseguito una sola volta lo script inserito in un suo frame, quello ke fa visualizzare la frase, il fatto è ke io voglio ke questo sia ciclico e ke quindi il testo venga riscritto, una volta terminata l'istanza in corso, ricominciando d'accapo dopo 2 secondi d'attesa...

    Ho provato in svariati modi ma nulla, nada, assolutamente tabù!!!

    Preciso ke sono un neofita, o meglio è un po' ke smanetto su Flash, e qualcosa l'ho imparato ma x mancanza di tempo nn sono mai riuscito a incrementare le mie capacità!!! (Pur avendo speso 120€ in manuali un annetto fa )

    Vi prego aiutatemi!

    A presto
    It's the only that we have...
    Save our Mother Earth...
    Salviamo Gea!!! :quipy:
    No War!!! >>---> JUST CLAIM FOR PEACE!!!!

  2. #2
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    Cambia lo script in:

    codice:
    //molto importante//
    /*
    se non avete il font "Helvetica 45 Light"
    potete cambiarlo con uno vostro.
    però ricordatevi che anche nel pannello di proprietà
    dovete cambiare il font.
    quindi se usate l'Arial dovete fare così:
    mt.font="Arial"
    selezionate il campo di testo e scegliete il font
    arial, altrimenti non funziona.
    per i più esperti questa opzione potete toglierla.
    buon divertimento
    */
    function charPositions(tFormat, str, depth) {
    	_root.createTextField("temp", depth, 0, -300, 100, 400);
    	temp.autosize = true;
    	temp.embedFonts = true;
    	temp.setNewTextFormat(tFormat);
    	var arr = [];
    	temp.text = str;
    	var totalWidth = temp.textWidth;
    	for (var i = 0; i<str.length; i++) {
    		temp.text = str.substr(i);
    		arr[i] = totalWidth-temp.textWidth;
    	}
    	return arr;
    }
    function setUpText(str, forma, lineLength) {
    	var positions = charPositions(forma, str, 2000);
    	var currentLine;
    	var lineHeight = forma.getTextExtent(str).height;
    	var finalPositions = [];
    	for (var i = 0; i<positions.length; i++) {
    		if (positions[i]>(lineLength+subtracta)) {
    			subtracta = positions[i];
    			currentLine++;
    		}
    		var x = positions[i]-subtracta;
    		var y = lineHeight*currentLine;
    		finalPositions[i] = {char:str.charAt(i), x:x, y:y};
    	}
    	return finalPositions;
    }
    function drawNext() {
    	var noo = this.createEmptyMovieClip("lett"+this.count, this.count);
    	var nextObj = charPos[this.count];
    	noo._x = nextObj.x;
    	noo._y = nextObj.y;
    	noo.createTextField("tex", 1, 0, 0, 100, 100);
    	noo.tex.text = nextObj.char;
    	noo.tex.embedFonts = true;
    	noo.tex.selectable = false;
    	noo.tex.setTextFormat(mt);
    	noo._alpha = 30;
    	noo.onEnterFrame = function() {
    		this._alpha += 5;
    		if (this._alpha>=500) {
    			this.onEnterFrame = function() {
    				if (this._alpha>=0) {
    					this._alpha -= 5;
    				} else if (this._alpha<0) {
    					delete this.onEnterFrame;
    					if(this.last){
    						_root.interval = setInterval(_root, "init", 2000, _root.str, _root.mt, 520);
    					}
    					this.removeMovieClip();
    				}
    			};
    		}
    	};
    	this.count++;
    	if (this.count>charPos.length) {
    		noo.last = true;
    		delete this.onEnterFrame;
    	}
    }
    function init(str, tForm, lineLength) {
    	delete subtracta;
    	temp.removeTextField();
    	clearInterval(interval)
    	charPos = setUpText(str, tForm, lineLength);
    	this.count = 0;
    	this.onEnterFrame = drawNext;
    }
    mt = new TextFormat();
    mt.font = "Arial";
    mt.size = 26;
    mt.color = 0xffffff;
    mt.bold = true;
    str = "cosa hai da guardare!? sono troppo bello!          scherzi a parte spero che vi possa                       piacere questo effetto!";
    init(str, mt, 520);
    stop();

  3. #3
    Ciau sommo NT,

    ti ringrazio tantissimo per l'aiuto..

    Lo proverò subito e prometto ke mi metterò a studiare più ke posso non appena sistemo un paio di cosette ke mi stanno impegnando non poco, così cerkerò di postare ank'io qualke aiuto agli altri!!

    So ke forse è kiedere troppo ma saresti così gentile da evidenziarmi (anke solo modificando la tua risposta) quali sono le modifike apportate??? Solo se hai voglia/tempo!!!

    R"C"R
    It's the only that we have...
    Save our Mother Earth...
    Salviamo Gea!!! :quipy:
    No War!!! >>---> JUST CLAIM FOR PEACE!!!!

  4. #4
    Utente di HTML.it L'avatar di negatyve
    Registrato dal
    Feb 2001
    Messaggi
    9,479
    codice:
    function charPositions(tFormat, str, depth) {
    	_root.createTextField("temp", depth, 0, -300, 100, 400);
    	temp.autosize = true;
    	temp.embedFonts = true;
    	temp.setNewTextFormat(tFormat);
    	var arr = [];
    	temp.text = str;
    	var totalWidth = temp.textWidth;
    	for (var i = 0; i<str.length; i++) {
    		temp.text = str.substr(i);
    		arr[i] = totalWidth-temp.textWidth;
    	}
    	return arr;
    }
    function setUpText(str, forma, lineLength) {
    	var positions = charPositions(forma, str, 2000);
    	var currentLine;
    	var lineHeight = forma.getTextExtent(str).height;
    	var finalPositions = [];
    	for (var i = 0; i<positions.length; i++) {
    		if (positions[i]>(lineLength+subtracta)) {
    			subtracta = positions[i];
    			currentLine++;
    		}
    		var x = positions[i]-subtracta;
    		var y = lineHeight*currentLine;
    		finalPositions[i] = {char:str.charAt(i), x:x, y:y};
    	}
    	return finalPositions;
    }
    function drawNext() {
    	var noo = this.createEmptyMovieClip("lett"+this.count, this.count);
    	var nextObj = charPos[this.count];
    	noo._x = nextObj.x;
    	noo._y = nextObj.y;
    	noo.createTextField("tex", 1, 0, 0, 100, 100);
    	noo.tex.text = nextObj.char;
    	noo.tex.embedFonts = true;
    	noo.tex.selectable = false;
    	noo.tex.setTextFormat(mt);
    	noo._alpha = 30;
    	noo.onEnterFrame = function() {
    		this._alpha += 5;
    		if (this._alpha>=500) {
    			this.onEnterFrame = function() {
    				if (this._alpha>=0) {
    					this._alpha -= 5;
    				} else if (this._alpha<0) {
    					delete this.onEnterFrame;
    					// se questo era l'ultimo movieclip,
    					// e siamo arrivati alla fine dell'animazione
    					// stabiliamo che tra 2 secondi verrà richiamata
    					// la funzione "Init" sulla root, passando i tre
    					// parametri iniziali
    					if(this.last){
    						_root.interval = setInterval(_root, "init", 2000, _root.str, _root.mt, 520);
    					}
    					this.removeMovieClip();
    				}
    			};
    		}
    	};
    	this.count++;
    	if (this.count>charPos.length) {
    		// se questo è l'ultimo movieclip della serie
    		// settiamo la variabile "last" come vera
    		noo.last = true;
    		delete this.onEnterFrame;
    	}
    }
    function init(str, tForm, lineLength) {
    	// resettiamo la variabile "subtracta"
    	// per poter reiniziare il ciclo
    	delete subtracta;
    	// rimuoviamo il campo di testo
    	temp.removeTextField();
    	// resettiamo l'intervallo di 2 secondi
    	clearInterval(interval);
    	charPos = setUpText(str, tForm, lineLength);
    	this.count = 0;
    	this.onEnterFrame = drawNext;
    }
    mt = new TextFormat();
    mt.font = "Arial";
    mt.size = 26;
    mt.color = 0xffffff;
    mt.bold = true;
    str = "cosa hai da guardare!? sono troppo bello!          scherzi a parte spero che vi possa                       piacere questo effetto!";
    init(str, mt, 520);
    stop();

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.