[FLASH] Problem z efektami textowymi

Witam!

Pobrałem stąd efekty textowe i mam problem z as, a dokładniej jak zrobić aby te efekty mogły być robione nie tylko na jednej linijce a na wielu…

Przykładowy kod AS :

i = 0;

h_space = 10;

x = 150;

y = 200;

tekst = "jeszcze jakis inny tekst";

this.onEnterFrame = function() {

	this.attachMovie("literka", "lt"+i, i);

	var clip = this["lt"+i];

	clip.txt = tekst.substr(i, 1);

	clip._x = i*h_space+x;

	clip._y = y;

	clip._alpha = 0;

	clip.onEnterFrame = function() {

		if (this._alpha<100) {

			this._alpha += 5;

		} else {

			this.onEnterFrame = undefined;

		}

	};

	if (i == tekst.length) {

		delete i;

		this.onEnterFrame = undefined;

	}

	i++;

};

To jest trochę lipnie rozwiązane bo robisz tak naprawdę attach na movieclipie. Takiego tekstu nie da się ani łatwo edytować ani łatwo usunąć ze sceny.

import flash.geom.Matrix;

var my_str:String = new String("A matrix is used mainly to transform (rotate, scale and translate) a movie clip. Any movie clip now has a property called transform. This is an object that contains another property called matrix. If you create a Matrix object and assign it to this movieclip.transform.matrix property, it will alter the form, size or position of that movie clip. We’ll see some concrete examples very shortly.");

//var my_str:String = new String("matrix");

var ile_znakow:Number = 1;

var dodatkowe_znaki:Number = 300;

var i:Number = 0;

var j:Number = my_str.length;

flower.asd.text = "";

var mouseListener:Object = new Object();

mouseListener.onMouseMove = function() {

	if (this.isDrawing) {

		var skewX:Number = (_xmouse-270)*.001;

		flower.transform.matrix = new Matrix(1, skewX, 0, 1, 270, 200);

	}

};

mouseListener.onMouseDown = function() {

	this.isDrawing = true;

};

mouseListener.onMouseUp = function() {

	this.isDrawing = false;

};

Mouse.addListener(mouseListener);

onEnterFrame = function () {

	if (i
		var mySubstring:String = new String();

		mySubstring = my_str.substr(i, ile_znakow);

		flower.asd.text += mySubstring;

		i += ile_znakow;

	} else {

		j -= ile_znakow;

		var mySubstring:String = new String();

		mySubstring = my_str.substr(0, j);

		flower.asd.text = mySubstring;

		if (j<0) {

			j = my_str.length;

			i = 0;

			flower.asd.text = "";

			delete onEnterFrame;

		}

		//          

	}

	aa.text = i+" "+j;

};

Wklej sobie ten kod i dodaj na scenie pole tekstowe o nazwie “asd” :slight_smile: Generalnie używając import flash.geom.Matrix; zrobisz dużo lepsze efekty łącznie z 3D i skalowaniem.