Posted by: Doug | October 4, 2008

AS3 Text Chat With Emoticons (Initial Prototype)

I’ve been developing a text chat widget for a client of mine and as part of the specification there is a requirement for emoticons inside of the html text. As far as i understand it’s quite difficult to achieve but i thought that some of the new TextField methods in AS3 might provide some solutions.

This is my first experiment and the code is reasonably complex but it works so please try it and let me know what you think.

AS3 Text Chat With Emoticons (First Version)

UPDATE: Please see this post AS3 Text Chat With Emoticons (Latest Version)


Responses

  1. My only suggestion would be to size the emoticons beforehand, the scaling is making it difficult to determine what the emoticon is.

    Very solid though.

  2. Thanks Nathan!

    Fair comment so i’ll add it to the todo list.

    Immediately i’m thinking of having different sizes of emoticons that get swapped out depending on text height…but there’s probably something even simpler ;)

  3. [...] Link to the original site [...]

  4. vectors doug, vectors ;)

    … also you can tie the size of the emoticon to the size of the code that it replaces. That way you can change the font size and see a change in the image size too.

  5. I’ve got the resizing thing sorted already!

    What do you mean about vectors Matt??? I guess it’s about using vectors over bitmaps when scaling (which i’m not yet doing).

  6. This is something I’ve been looking for! Great job, I would love to help finish it up if you’re still working on it.

  7. @Dave – did you see this version??

    http://deceptiveresolution.wordpress.com/2008/10/21/textchat-with-emoticons-as3-fms3/

    It’s pretty much complete barring a few minor bugs with the emoticon parser.

    Let me know what you’re up to and we can have a chat about this in more detail if you want.

  8. GREAT WORK!
    i’m developing a similar chat in Flex but i have some problems with gif files alignment in htmlText.
    For example, replacing three strings typed in a line with proper gif emoticons, the images are displayed out of line… in the bottom of text, one under the other.
    What textfield class or component are you using?
    I’m using TextArea and it seems there are several bugs in it…
    Using swf files instead of gif will solve some alignment problems?
    Thankyou Doug!

  9. @rand see the other post

  10. Doug:
    Since you possible have a solution for me, can you let me know if you ever finish your chat version? We are current trying to migrate an as2 flash chat version to as3, so you could have it ready to go, can you contact me and have a conversation about it? muwiess@hotmail.com

  11. Yes I have, but when it initilizes says:
    unexpexted server initialization error!

    NetConnection.Connect.Failed
    that is in firefox, on exporer doesn’t say anything.
    Where I can look the code? It has a cost?
    I will like to test it on my applet

    Manuel

  12. Actually I could login to a different room than demo.
    I like the feature of add different rooms.

    Manuel

  13. found a bug: the emoticons doesn’t scroll with the textfield.. when the textfield has too many lines and you use the mid-button to scroll the textfield the emoticons stay where they are.

  14. If you look at the comments above you should find a link to the latest version which doesn’t have that issue and has many more features.

    Cheers


Leave a response

Your response:

Categories