Text animation

Ive tried and tried to get text animation ( www.help4flash.com/tutori…tani.shtml ) to work, but i cant.\rI always end up with only the same letter over and over animating instead of the text i write in.\rCan someone send me a fla on how its done?

i dont’ think that tutorial was made with flash 5. that might be where your trouble is. I’m not really sure how to fix it, and don’t have the time right now to look it over.

NT =)

that’s an OLD tutorial from www.flashaddict.com (virtual-fx now). it’s in flash 4. basically you animate one dynamic text field then you duplicate (or attach) that movie clip for each letter. there’s some math in there to figure out the character spacing and when to do a carriage return, etc.\reach part of it is simple, it’s just a pain to create an array of all the character widths. back then you had to use one long string and an index that was actually the starting point of the substring…remember those days?!\ranyways, it’s easier with arrays, but still time consuming.\r:) \rjeremy\r\rp.s. i will not be supplying a sample file for this…maybe.

Thats what i thought, the tutor from help4flash was old, but i downloaded a fla from flashkit.com (www.flashkit.com/textfx/sdk.shtml)\rI tried to make exactly the same movie, but cant get it to work.\rHeres the fla from flashkit: [url=“http://topelite.netfirms.com/real.fla”]topelite.netfirms.com/real.fla\rHeres the one i made: [url=“http://topelite.netfirms.com/test.fla”]topelite.netfirms.com/test.fla)\rWhat am i doing wrong?\rIt says something about the movieclip letter, and char in the script, but i could only find the movie letter…\rHope you can help as ive tried this for a long time now!!

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.