A Flash Developer Resource Site

1. rotate text in spiral

Hi,

I already have my function to make the spiral, but I dont know what factor or equation need to calculate the rotation of each char. This is what I have for now and look where I put the comment.

Thanks!

Rafael G

PHP Code:
``` string = "blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah "; textList = []; for (x=0; x<string.length; x++) {     textList.push(string.substr(x, 1)); } trace(textList); var my_fmt:TextFormat = new TextFormat();  my_fmt.font = "Font 1"; my_fmt.bold = true; my_fmt.size = 12; _root.createEmptyMovieClip("holderMC", 1); theta = 10; a = 10; step = 1 prevPtX = Stage.width/2; prevPtY = Stage.height/2; drawI = setInterval(drawF, 1); function drawF() {     theta = theta+.1;     a += 0.01;     rad = theta*a;     nextPtX = rad*Math.cos(theta)+Stage.width/2;     nextPtY = rad*Math.sin(theta)+Stage.height/2;     step++;     _root.createTextField("t"+step, step, nextPtX, nextPtY, 10, 10);     _root["t"+step].wordWrap = true;     _root["t"+step].embedFonts = true;     _root["t"+step].textColor = 0xFFFFFF;     _root["t"+step].text = textList[step];     _root["t"+step].setTextFormat(my_fmt);     _root["t"+step]._x = newX;     _root["t"+step]._y = newY;     _root["t"+step]._rotation = ????????????; // here need the rotation function          if (textList[step] == undefined) {         clearInterval(drawI);     }          prevPtX = nextPtX;     prevPtY = nextPtY; }  ```

2. theta is the angle of your current spot in the spiral - you just need to convert it from radians to degrees.

_root["t"+step]._rotation = theta * 180/Math.PI;

- Jim

3. Really thanks! work perfect

Rafael

Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

 » Home » Movies » Tutorials » Submissions » Board » Links » Reviews » Feedback » Gallery » Fonts » The Lounge » Sound Loops » Sound FX » About FK » Sitemap