# movieClip in a dynamic textbox

**URL:** https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177
**Category:** flash
**Created:** [September 13, 2004, 10:44pm UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177 "2004-09-13T22:44:20Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![mkeefe](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mkeefe/32/513_2.png) [@mkeefe](https://forum.kirupa.com/u/mkeefe)
#### Post date: [September 13, 2004, 10:44pm UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/1 "2004-09-13T22:44:20Z")

</div>

I am writing a flash project and am entirely lost on how to include a movieclip in a dynamic textbox? Is this possible, if so how? An example of what I am trying to accomplish is a chat client that has the text replaced with a smiley.

Anyone have any idea how to get this to work?

-matt

---

<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: [September 14, 2004, 12:38am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/2 "2004-09-14T00:38:12Z")

</div>

You can’t just place a movieclip inside a textbox of any kind. You could, however, create a movieclip and inside THAT movieclip, you’d put your textbox and your other movieclip but it’s not possible to put a movieclip actually _inside_ a dynamic textbox.

---

<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: [September 14, 2004, 12:45am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/3 "2004-09-14T00:45:01Z")

</div>

Thank you for your quick repsonse.

Ok then assuming my previous question is not possible. How would I go about writing a smiley function for dynamic text?

I basically want to write a search and replace that will take a : ) and turn it into a smiley graphic. Any ideas or resources that could help me out?

-matt

---

<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: [September 14, 2004, 12:56am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/4 "2004-09-14T00:56:38Z")

</div>

Hmmm… I’m not aware of any resources for this and I’m a little bit of a loss I’m afraid! I’ve got a lot of ideas but you’ll run into problems with them I’m sure.

If you’re still interested though, here’s what you could do…

Create a movieclip that has a “onClipEvent (enterFrame)” event so the code inside keeps constantly repeating itself. That code would check to see if the last two characters in your textfield were “:)” and if so, remove them and attach a movieclip that would presumably contain your smiley face.

Functions you would need to use for this solution might be…  
attachMovie  
subStr

Sorry I couldn’t be of more help but good luck! Sounds like a complicated project!

---

<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: [September 14, 2004, 1:16am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/5 "2004-09-14T01:16:10Z")

</div>

I am working out the search and replace issue, but how would i go about placing this smiley so it looks inline? For instance in the middle of the message.

thank you

-matt

---

<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: [September 14, 2004, 1:21am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/6 "2004-09-14T01:21:50Z")

</div>

Yeah, that’s the problem I thought you’d run into and to tell you the truth, I’m not entirely sure! If you could find out the position (in pixels) of where the cursor is when the “:)” has been detected, you could just use a line like this…

```auto

attachMovie("smiley","smiley",1);
smiley._x = //THE XPOS OF THE CURSOR
smiley._y = //THE YPOS OF THE CURSOR

```

Again though, I’m not sure if it’s possible to find out the position of a text cursor relative to the stage. Sounds like you might need to start a serious google-session!

---

<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: [September 14, 2004, 1:25am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/7 "2004-09-14T01:25:22Z")

</div>

hmm… I am so lost on this one. I am not aware of the ability to find the pos of the cursor. Is there a way to write the string and then search it. Find the place where the : ) is, and place a smiley face above it on another layer?

---

<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: [September 14, 2004, 1:30am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/8 "2004-09-14T01:30:58Z")

</div>

Give me a minute mate and I’ll get back to you. I gotta give this some thought…

---

<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: [September 14, 2004, 1:40am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/9 "2004-09-14T01:40:03Z")

</div>

how about taking a smiley font… then doing a string search and replace and inserting the appropriate smiley symbol?

---

<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: [September 14, 2004, 1:42am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/10 "2004-09-14T01:42:31Z")

</div>

@3rdeye  
good suggestion but i need it to be really slick graphics in full color. like the smilies on Kirupa.

-matt

---

<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: [September 14, 2004, 1:53am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/11 "2004-09-14T01:53:09Z")

</div>

Sorry mate, I’m tired out (it’s 2:50AM here!).

It looks like you CAN embed images in a textfield. Check out “Using HTML in textfields” in Flash’s help and, in particular, the “Render text as HTML” option in the property inspector for the textfield.

I’ve done what the helpfile said but for some mad reason, it ain’t workin. I think I’m just too tired and I’m missing something stupid.

Couple of things to remember though–for this to work, your textfield has to be set to Multiline (with wrapping) and you can only use either SWFs or JPEGS. I also think that you can’t use _progressive_ JPEGS.

Good luck and let me know how you get on,  
Dave

---

<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: [September 14, 2004, 1:56am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/12 "2004-09-14T01:56:47Z")

</div>

ok thank you goodnight. I will catch up with you tomorrow.

-matt

---

<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: [September 14, 2004, 3:23am UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/13 "2004-09-14T03:23:54Z")

</div>

well HTML image tags will work, but aligning them is impossible… as far as I can tell… how come a custom font has to be black and white? or un animated… must be some stupid IEEE standard or something?

---

<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: [September 14, 2004, 1:02pm UTC](https://forum.kirupa.com/t/movieclip-in-a-dynamic-textbox/64177/14 "2004-09-14T13:02:51Z")

</div>

> [@3rdeye](#):
>
> well HTML image tags will work, but aligning them is impossible… as far as I can tell… how come a custom font has to be black and white? or un animated… must be some stupid IEEE standard or something?

Um… I think a font can be a solid color, but am not aware as to whether or not it can have animation to it? I don’t think it can.

-matt
