Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make symbols follow a path

Status
Not open for further replies.

johnnyv

Programmer
Jul 13, 2001
216
CA
Hello

I am trying to copy 2 effects from the following page
question 1
What I want to do is have a sentence follow a path exactly like the words do on the above page. The only way I know how to do this is to create a symbol for each letter. Is there a way to have all of the text in one symbol and have that symbol 'wrap' around the oval path as it follows it?

question 2
You will notice that the coloured text appears to go behind the wine glass. As it does this it 'distorts' slightly. How can I recreate this effect?

Thanks in advance for all replys
 
question 1....this runs the text in a circle...

1. insert>new symbol>movie clip
2. add a dynamic text box and give it a variable name letter. set font and font color.
3. open up the library right click the clip you just made and select linkage....give it a linkage name of letterMC

4. add this code to the main timeline. just copy and paste changing the text to your own in the first line.

var textStr = "This is the text to go in a circle";
var textArr = textStr.split("");
var len = textStr.length;
var angbase = 360 / len;
var radius = 110;
var center_x = 200;
var center_y = 200;
var speed = .75;

for(var i=0; i<len; i++) {
var lObj = {};
lObj.angle = angbase * i;
lObj.id = i;
lObj.onEnterFrame = handle_ltr;
attachMovie(&quot;letterMC&quot;,&quot;l_&quot;+i,i,lObj);
}

function handle_ltr() {
this._x = center_x + Math.cos(this.angle * Math.PI / 180) * radius;
this._y = center_y + Math.sin(this.angle * Math.PI / 180) * radius;
this._rotation = Math.atan2(center_y-this._y, center_x-this._x) * 180 / Math.PI + 270;
this.letter = textArr[this.id];
this.angle += speed;
}
 
Question 2... the white/distort effect is a combination of a white graphic of the glass (perhaps with a bit of a gradient fill in there) which has the _alpha setting dropped to about 30% for semi-transparency. The refracted distortion could be recreated by having two version of the rotating text being run by the script, one a tiny bit bigger than the other. Then apply a mask in the same shape as the glass to these layers so that the smaller text is hidden and the larger text shows through.
 
Thanks for the replys. Exactly what I was looking for
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top