# \[FMX\] text -\> movieclip

**URL:** <https://forum.kirupa.com/t/fmx-text-movieclip/11609>\
**Category:** flash\
**Created:** [January 20, 2003, 3:15am UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609 "2003-01-20T03:15:34Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Roko](https://avatars.discourse-cdn.com/v4/letter/r/3d9bf3/32.png) [@Roko](https://forum.kirupa.com/u/Roko)\
**Post date:** [January 20, 2003, 3:15am UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/1 "2003-01-20T03:15:34Z")

</div>

Hi, I’d be grateful if someone help me.

There’s a textfield(Var: inputText), a button and MovieClips(ASCII values 32 to 126).  
When you input some letters to the textfield and push the button, I wanna show you the MovieClips of letters which you just input. (you input “flash” -\> push the button -\> the MovieClips “f” “l” “a” “s” “h” appear.)

I wrote some scripts to the frame1 (\_root.movieclips.\_visible = false; …) and the button(see following).

on (release) {  
s = new String(\_root.inputText);  
if ( s.slice( 0, 1 ) == “A”) {  
\_root.A.\_visible = true;  
} else if ( s.slice( 0, 1 ) == “B”) {  
\_root.B.\_visible = true;  
// continue and continue and continue…  
}  
if ( s.slice( 1, 2 ) == “A”) {  
\_root.A2.\_visible = true;  
// continue…  
}  
}

\*the instance names of the movieclips are A, B, C, …

I know this scripts are lengthy and not great. But I couldn’t think any more. Should I use the “attachMovie” or something else? If so, how can I write the scripts briefly?  
I’m a really really beginner so there must be strange points in my explanation… sorry.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 4:15am UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/2 "2003-01-20T04:15:24Z")

</div>

Are you trying to do something like this…

[http://www.kirupa.com/developer/actionscript/ascript\_text\_animation.asp](http://www.kirupa.com/developer/actionscript/ascript_text_animation.asp)

???

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 8:13pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/3 "2003-01-20T20:13:37Z")

</div>

Thank you for replying me lostinbeta, but no, sorry, I couldn’t explain correctly.  
I wanna show you the movieclips of alphabets.  
I wanna use the strange font to show you some characters but I don’t think  
all of you have the same font as mine. so…  
Do you understand the meaning from my explanation?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 9:41pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/4 "2003-01-20T21:41:12Z")

</div>

I think so, not sure I have the skill to do it, but I will give it a try.

If I am reading your original method correctly you would have about 6 million lines of code for a word…lol.

I am sure there is an easier way… I just have to figure it out 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 9:55pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/5 "2003-01-20T21:55:01Z")

</div>

Alright well I have this SO FAR…

Create 3 movie clips. In the library right click on them and go to the linkage properties. Click on the “Export for Actionscript” checkbox.

While in the linkage properties, give one the name “a”, another the name “b”, and a third the name “c”.

Then put this code in a Frame.

```php
myString = "abc";
end = myString.length;
for (i=0; i<end; i++) {
	_root.attachMovie(String(myString.charAt(i)), String(myString.charAt(i))+i, i);
	letter = _root[String(myString.charAt(i))+i];
	letter._x = 27*i;
}

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:06pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/6 "2003-01-20T22:06:27Z")

</div>

Ok, I finished a version on my end. I can’t believe I pulled this off myself!!!

I am so proud of myself…lol.

Check the attachment .fla.

You will need to go to Control/Test Movie to see it work. Of course it is generic and I just used basic letters no animations, but I was trying to whip it up real quick.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:10pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/7 "2003-01-20T22:10:04Z")

</div>

easier way 🙂

yes you should use attachMovieclip, no you should not do it that way. 😉

first off, instead of having THAT many movieclips, just make one movieclip with **frames** for each letter. If you already made and named the movieclips, Im sorry. Having them in one movieclip means you dont need instance names (or to set linker IDs for attaching) for EVERY letter. All you need is that one clip and then just use a gotoAndStop to go to the letter you need it to.

Then, all you need to do is, probably on textField.onChanged is attach that clip with all the letters and add it to what letters are already there (providing the proper offset) and then tell it to goto and stop at the frame of that letter, which you could actually have in there placed based on their ASCII value, or do something like the ASCII-31 or whatever.

The only problem will be that the changing of the textfield isnt always linear, meaning someone could go back and change the first word in which case you would have to re-attach everything - so you might just want to attach everything on every onChanged.

[edit] started this before lost posted his example so I dont know if this is ‘easier’ than that or not ;)[/edit]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:13pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/8 "2003-01-20T22:13:16Z")

</div>

Hey Sen… Good method. As I said before… I am just glad I was able to pump something out that actually worked…lol.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:30pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/9 "2003-01-20T22:30:46Z")

</div>

Hey lostinbeta! You’re genius!!  
Thank you very much for your work, I really appreciate it.

And senocular, thank you for your idea.  
I guess your method is great, but as I wrote before,  
I’m a really beginner and I’m not sure whether I can do it  
according to your method… but I’ll try at least.

Anyway thank you very much!  
I think I’m happier than you lostinbeta! lol.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:32pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/10 "2003-01-20T22:32:07Z")

</div>

Hey no problem Roko. I am glad I could save you having to write 6 billion lines of code.

And I am not a genius 😊

I learned the String(expression) method from Sen here… he taught me a ton.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:43pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/11 "2003-01-20T22:43:35Z")

</div>

> \*Originally posted by lostinbeta \*  
> \*\*  
> And I am not a genius 😊

I learned the String(expression) method from Sen here… he taught me a ton. \*\*

hense you _know_ a ton, hense you _are_ a genius 🙂

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:46pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/12 "2003-01-20T22:46:07Z")

</div>

LOL… no, I didn’t mean it like that!

I meant that you taught me a lot of things recently that I didn’t know before… which wasn’t hard… because I didn’t know that much :beam: 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:55pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/13 "2003-01-20T22:55:17Z")

</div>

OK, you guys are both genius.

lostinbeta, you’ve got a great teacher and you’re a great teacher  
for me as well!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [January 20, 2003, 10:57pm UTC](https://forum.kirupa.com/t/fmx-text-movieclip/11609/14 "2003-01-20T22:57:52Z")

</div>

It was my pleasure 🙂

I taught myself something just now too :beam:
