Extending / Customizing TextArea

Posted on 2005-05-10
Last Modified: 2012-06-27

I am using Macromedia Flash MX 2004 Professional and I have a text area component that i am using as a chat window. I want to be able to replace certain keywords with emoticons in the chat. I can replace the keywords no problem using regular expressions, but I can seem to get the images to dynamically fit into the text the way the are supposed to.

For example:

I have the string:

hello :-) how are you

I can replace this with:

hello <img src='smile'> how are you

but the image does not go where it is supposed to. I goes all the way to the right of the line. I would like to have the images placed dynamically in the text like a normal IM or chat application. Also, the image sometimes does not appear until another line of text is written to the TextArea.

Does anyone have a way to make this work?


Question by:xeon999
    1 Comment
    LVL 27

    Accepted Solution

    3 solutions:

    2. create your own font with smilies as characters
    3. use a List component, and create line by line

    By now, img control in a TextArea is very very poor..

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Introduction This article is primarily concerned with ActionScript 3 and generally specific to AVM2.  Most suggestions would apply to ActionScript 2 as well, and I've noted those tips that differ between AS2 and AS3. With the advent of ActionS…
    The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
    The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
    The goal of the tutorial is to teach the user what frame rate is, how to control it and what effect it has on the video.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now