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)
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.
By: Nathan Levesque on October 4, 2008
at 4:31 pm
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
By: Doug on October 4, 2008
at 4:59 pm
[...] Link to the original site [...]
By: Fredericton Designers » Blog Archive » AS3 Text Chat With Emoticons (Initial Prototype) on October 4, 2008
at 7:35 pm
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.
By: mattjpoole on October 8, 2008
at 1:01 pm
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).
By: Doug on October 8, 2008
at 1:56 pm
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.
By: Dave on November 20, 2008
at 5:17 pm
@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.
By: Doug on November 22, 2008
at 5:59 pm
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!
By: rand on February 2, 2009
at 1:59 am
@rand see the other post
By: Doug on February 2, 2009
at 10:52 am
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
By: Manuel on March 28, 2009
at 12:54 pm
Hi manuel did you see this version?
http://deceptiveresolution.wordpress.com/2008/10/21/textchat-with-emoticons-as3-fms3/
By: Doug on March 29, 2009
at 8:44 am
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
By: Manuel on March 30, 2009
at 3:21 pm
Actually I could login to a different room than demo.
I like the feature of add different rooms.
Manuel
By: Manuel on March 30, 2009
at 3:26 pm
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.
By: g on July 30, 2009
at 1:08 am
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
By: Doug on July 30, 2009
at 8:34 am