| |||||||
Du magst keine Werbung? Wir auch nicht!
Einfach registrieren und die Werbung ist weg. Diese Nachricht sehen nur nicht registrierte Nutzer.
![]() |
| | LinkBack | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Neuer User Registriert seit: Jun 2004
Beiträge: 12
| TXT ani & colorSet
Hallo Zusammen, hab hier en problem mit der Farbpalette des textes trackTextWriteOn("textMC", 100, "<font face='Arial' size='12' color='#000000'>"+mystring2+"</font>", 0, 0, "brown"); trackTextWriteOn("textMC", 50, "<font face='Arial' size='12' color='#000000'>"+mystring+"</font>", 0, 0, "grey"); er nimmt immer nur die letze cmd farbe für beide sets obwohl ich eine andere angegeben habe achja für 2nd func myMC erstellen ///////////////////////////////////////////////////// MovieClip.prototype.trackTextWriteOn = function(textMC, depth, str, startX, yOffset, colorSet) { if (colorSet == "grey") { colorSet1 = ["#cccccc", "#eeeeee", "#999999", "#666666", "#333333", "#000000"]; } if (colorSet == "brown") { colorSet1 = ["#2E2B21", "#544F3D", "#7E765A", "#A7A083", "#C9B9A9", "#D1C1B1"]; } trace("TXT ANI STARTS"); this.createEmptyMovieClip(textMC, textMC, depth); this[textMC]._x = startX; this[textMC]._y = yOffset; this[textMC].createTextField("txt", "txt", 0, 0, 150, 150); // //////////////////////////////////////////////////////////////////////// this[textMC].txt.multiline = false; this[textMC].txt.selectable = false; this[textMC].txt.autoSize = true; this[textMC].txt.html = true; this[textMC].txt.htmlText = ""; // /////////////////////////////////////////////////////////////////////// this.strlength = str.length; var i = 0; var j = 5; this.onEnterFrame = function() { this.tempstring = ""; for (var l = 0; l<=j; l++) { this.tempstring += str.charAt(l); } this.randomstring = ""; var s = 0; for (var k = j; k<=Math.min(i, this.strlength-1); k++) { s += 1; switch (s) { case 1 : col = colorSet1[0]; break; case 2 : col = colorSet1[1]; break; case 3 : col = colorSet1[2]; break; case 4 : col = colorSet1[3]; break; case 5 : col = colorSet1[4]; break; case 6 : col = colorSet1[5]; break; } this.randomstring += "<font face='Arial' size='"+(this.textsize-s)+"' color='"+col+"'>"+String.fromCharCode(Math.floor(M ath.random()*15)+97)+"</font>"; } this.resultstring = this.tempstring.substring(0, j)+this.randomstring; if (j>=str.length) { delete this.onEnterFrame; } if (this.strlength>20) { i += 5; j += 1.5; } else { i++; j += .75; } this[textMC].txt.htmlText = this.resultstring; }; }; mystring = "1111111111111111111111111111111111111111111111111 1111111111"; mystring2 = "2222222222222222222222222222222222222222222222222 22222222"; trackTextWriteOn("textMC", 50, "<font face='Arial' size='12' color='#000000'>"+mystring+"</font>", 0, 0, "grey"); myMC.trackTextWriteOn("textMC", 100, "<font face='Arial' size='12' color='#000000'>"+mystring2+"</font>", 0, 0, "brown"); thx Brian |
| | |
![]() |
| Lesezeichen |
| Themen-Optionen | |
| Ansicht | |
| |