Смысл скрипта в следующем: Им имеется динамическое текстовое поле с некоторым значение. После запуска мувика, скрипт, в данном текстовом поле создает эффект посимвольного перебора букв.
Динамическое поле имеет следующие параметры: name:tx0 var:txt0
Само содержание скрипта
Код
function input(curChar) {
function pickChar() {
smType = useType.charAt(Math.floor(Math.random()*useIn));
//trace(smType);
return (smType);
}
useType = "BRIGHTCOLOR";
useIn = useType.length;
finTx = new Array(maxrow);
len = new Array(maxrow);
for (var _loc2 = 0; _loc2<maxrow; ++_loc2) {
finTx[_loc2] = this["tx"+_loc2].text;
len[_loc2] = finTx[_loc2].length;
this["tx"+_loc2].text = "";
}
currentRow = 0;
currentChar = curChar;
this.onEnterFrame = function() {
++currentChar;
if (currentChar>len[currentRow]) {
this["tx"+currentRow].setTextFormat(this._fmt);
currentChar = 0;
++currentRow;
if (currentRow>maxrow) {
delete this.onEnterFrame;
this["tx"+currentRow].setTextFormat(this._fmt2);
}
}
chars = finTx[currentRow].substr(0, currentChar);
this["tx"+currentRow].text = chars;
this["tx"+currentRow].setTextFormat(this._fmt);
for (var _loc2 = currentChar; _loc2<len[currentRow]; ++_loc2) {
this["tx"+currentRow].text = this["tx"+currentRow].text+pickChar();
this["tx"+currentRow].setTextFormat(this._fmt);
}
};
}
this._fmt = new TextFormat();
this._fmt.letterSpacing = 0;
maxrow = 12;
input();
stop();
function pickChar() {
smType = useType.charAt(Math.floor(Math.random()*useIn));
//trace(smType);
return (smType);
}
useType = "BRIGHTCOLOR";
useIn = useType.length;
finTx = new Array(maxrow);
len = new Array(maxrow);
for (var _loc2 = 0; _loc2<maxrow; ++_loc2) {
finTx[_loc2] = this["tx"+_loc2].text;
len[_loc2] = finTx[_loc2].length;
this["tx"+_loc2].text = "";
}
currentRow = 0;
currentChar = curChar;
this.onEnterFrame = function() {
++currentChar;
if (currentChar>len[currentRow]) {
this["tx"+currentRow].setTextFormat(this._fmt);
currentChar = 0;
++currentRow;
if (currentRow>maxrow) {
delete this.onEnterFrame;
this["tx"+currentRow].setTextFormat(this._fmt2);
}
}
chars = finTx[currentRow].substr(0, currentChar);
this["tx"+currentRow].text = chars;
this["tx"+currentRow].setTextFormat(this._fmt);
for (var _loc2 = currentChar; _loc2<len[currentRow]; ++_loc2) {
this["tx"+currentRow].text = this["tx"+currentRow].text+pickChar();
this["tx"+currentRow].setTextFormat(this._fmt);
}
};
}
this._fmt = new TextFormat();
this._fmt.letterSpacing = 0;
maxrow = 12;
input();
stop();