Text animation

check this out…\rjeremydecker.s5.com/test_revised.fla\r[url=“http://jeremydecker.s5.com/test_revised.swf”]jeremydecker.s5.com/test_revised.swf\ri only got the text to work, everything after that third keyframe i didn’t even look at.\r:) \rjeremy

thanx, but what did i do wrong?\rIf i renamed the mc i made from letter to char, i only got w’s instead of the text i wrote.

once you tween a dynamic text field it gets turned into a graphic. the text field itself shouldn’t be tweened, it should be turned into a movie clip and that movie clip should be tweened. plus, the instance name of the clip on the stage was ‘letter’ and you were duplicating ‘char’.\ri cleaned up the code a little by getting rid of those pesky getProperty statements and a few other things.\r:) \rjeremy\r\rp.s. and i added code so the kerning will work no matter what size you choose to make the text.

When i go to mcChar that you made, and click on it, it says mcLetterForTweening in the instancebox and not mcChar, how did you do that?\r\rI think my problem is that i dont know how to make the MC right, or maybe im just too dumb.\r\rIs it right when i name the MC mcLetter in the MC itself, and char on stage?

‘mcLetterForTweening_master’ is the mc’s library name, not it’s instance name. when you refer to clips on the stage you use their instance name only.\r:) \rjeremy

Dont know how to make te mc right, later…

hellow

Sinf, i hope you look in here. I really don’t like asking people to explain this stuff to me, but I have no idea how to do this. I dled your FLA for this text effect, and I was wondering if you could give me a run-down of what these things do…\r\r_root[“char”+ii].mcLetter.text=text.substr(ii, 1);\r\r\rdon’t get the _root[] thing, or the mcLetter.text = text.substr(ii,1)\r\rand i don’t understand the significance of the following.\r\rFrame 5:\rif (Number(showed) == Number(max)) {\r gotoAndPlay (Number(_currentframe)+2);\r\rFrame 7:\ri = “1”;\rremoved = “0”;\r\rFrame 8\rtellTarget (“char” add i) {\r play ();\r}\ri = Number(i)+1;\r\r**Frame 9</>\rif (Number(i)<=Number(max)) {\r gotoAndPlay (_currentframe-1);\r} else {\r stop ();\r}\r}\r\r\rAlso, how would I make the text go down a line if it got too long? Say I want 10 words on the first line, then 10 words on the next line down etc…like I was writing a paragraph…

ok, i can explain the code i put in there, but i didn’t do anything beyond frame 3. here goes…\r_root[“char”+ii].mcLetter.text=text.substr(ii, 1);\r\rthis is the movie clip that contains the tweened movie clip.\r_root[“char”+ii]\r\rthis is the tweened movie clip.\r_root[“char”+ii].mcLetter\r\rthis is the text field inside the tweened movie clip.\r_root[“char”+ii].mcLetter.text\r\rthis is the single letter that will be placed in the text field of the tweened movie clip.\rtext.substr(ii, 1)\r\rhope that explains it a little. if you’re not familiar with the use of square brackets start a new thread and i’ll explain it as best i can. it’s basically shorthand for ‘eval’.\rnow, to make this file do carriage returns is complicated, but not impossible. i’ll explain how to do it, but i won’t do it because i don’t have the time to tweak the code right now. i might get to making a new sample file this week - but i might not…i have MANY diapers to change these days.\ranyways, here is the process that i would use to detect end of line:\rin the ‘for’ loop where the mc’s are duplicated i would skip the duplication for spaces. when skipping that duplication i would set a variable noting the index of the space. in each loop i would see if the character would fit within the set boundaries.\rif a character doesn’t fit i would advance a counter that would increment the _y positions by the desired line height.\rif the character in a word doesn’t fit, then the loop would go back to the index of the last space plus one (the first letter after the last space) and start the new line of text.\rcharacter spacing is a pain. it’s pretty tedious figuring out the width values of all the characters in a font, but once it’s done you don’t have to do it again and you can use it a lot.\r:) \rjeremy

actually i think there is already a thread that explains the root and eval. Thanks a lot Sinf. Don’t worry about making a file, I think I can figure it out from here.

I did it! :):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):):)\r\rits very ugly right now, so don’t laugh, but I just have to fix it up, but now its all cosmetic work. \r\r<embed src=“http://www.angelfire.com/dc/vidgame/tutorials/text_test.swf” height=300 width=400></embed>\r\rI think i’m going to do a tutorial that will update the code from the Help4Flash site, unless you have a problem with that… Thanks for the ideas Sinf.

nice work!\ri’ve always been lazy and used fixed width fonts. i can’t wait to see what you come up with so let us know what you’re done!\r:) \rjeremy

SINF ITS PRETTY NOW!!\r\r<embed src=“http://www.angelfire.com/dc/vidgame/tutorials/text_text.swf” ></embed>\r\rbut for some reason, my MC wouldn’t display the letters when I wanted to rotate it. It works ok, in this file, but in my other file whenever there is a rotation tween, it does not display the letters. Any ideas?

you need to include the outline of the font if you want to rotate/skew the text. kind of annoying how that works.\r:) \rjeremy

thanks. I knew i was missing something minor. thanks again for all your help.

you put that together really well! can you post the fla or email it to me? i’d like to see your code and how you set it up with the kerning, etc.\r:) \rjeremy

of course i can. Anything for you Sinf, you’re my hero :lol:

www.angelfire.com/dc/vidg…_text.html

just click the link above and then click the fla link. My free webserver won’t let me off-server link to FLAs

I had originally posted the wrong files, so if you downloaded them before now, then you got the wrong ones. They are pretty much the same, but the new one has more text, and some of the variables are changed.

<embed src=“http://www.angelfire.com/dc/vidgame/tutorials/text_text.swf” height=560 width=550></embed>

nice and clean, just the way i like it. i wouldn’t change a thing in that file!
great work on that one.
:slight_smile:
jeremy

thank you. that means a lot to me :slight_smile: