PDA

View Full Version : Spiral text


Xeef
09-05-2004, 10:30 PM
not sure is it the right place to post ?

var my_fmt:TextFormat = new TextFormat();
//YOU NEED a FONT SYMBOL WHIT LINKAGE NAME "Font 1" IN THE LIBRARY
my_fmt.font = "Font 1";
T = "Hallo This is a Spiral Text and Even Colored :)";
Text = [];
q = 0;
ToCount = 0;
for (a=0; a<T.length; a++) {
txt = {step:0, alpha:0, color:0, color2:0, text:T.substr(a, 1)};
Text[a] = txt;
}
function spiral() {
q++;
if (q>10) {
q = 0;
if (ToCount<Text.length-1) {
ToCount++;
}
}
for (count=0; count<ToCount+1; count++) {
txtName = "L"+count;
if (Text[count].step<1000) {
if (Text[count].alpha<100) {
Text[count].alpha++;
}
if (Text[count].step>900) {
Text[count].alpha -= 2;
}
Text[count].step++;
x = 250+(200-Text[count].step/10)*Math.sin((100+Text[count].step)/180*Math.PI);
y = 250+(200-Text[count].step/10)*Math.cos((100+Text[count].step)/180*Math.PI);
if (!eval(txtName)) {
_root.createTextField(txtName, count, x, y, 10, 10);
}
Text[count].color++;
if (Text[count].color>255) {
Text[count].color = 0;
Text[count].color2 += 10000;
}
eval(txtName).wordWrap = true;
eval(txtName).embedFonts = true;
eval(txtName).text = Text[count].text;
eval(txtName).setTextFormat(my_fmt);
eval(txtName)._x = x;
eval(txtName)._y = y;
eval(txtName).textColor = Text[count].color2+Text[count].color;
eval(txtName)._alpha = Text[count].alpha;
eval(txtName)._rotation = 80-Text[count].step;
} else {
Text[count].step = 0;
Text[count].alpha = 0;
}
}
}
setInterval(spiral, 1);

sim-2000
04-02-2008, 01:54 PM
Hi Xeef,

I just bumped into your spiral text script - fantastic.
I've been trying a few things with it, but I can't seem to get the text rotating the other way around - so it starts in the centre and spirals out.
I'd like to have the text adding all the time so the circle gets bigger - it doesn't have to rotate.

Thank you very much for you help!

Sim