How to add smiley to chat application using Action Script 3 in Flash Professional

This may be simple task when someone give you this, But really some what difficult is there  while positioning smiley in the textfield. I had gone through Google none of them explained this.

Download sample files here.

Here is simple way I had tried to position the smiley in chat application at exact position, may it useful to you guys. Try this and let me know if you have any ideas about smiley positioning.

In this tutorial I getting text and smiley we had entered in the textbox and save it in a string variable. Then using split() method I split-ed that string   into text and smiley and saved it in array variable. Now you can get text and smiley separately using array index like.

str1[0]= hi every body

str1[1]=<img src=’eye.jpg’ vspace=’-20′ height=’40′ width=’40′/>

Now I added this ‘str1[0]= hi every body‘ in the TextField to know width of text to position the smiley in after the text. Then adjusting vspace and hspace property of img tag I positioned smiley at exact position.

To know various techniques for finding  text width of TextField refer my previous tutorial ‘how to find text width of TextField using ActionScript 3 in Flash professional’

How to add smiley to chat application in Action Script 3 Flash Professional

 

Posted by:

muni

Leave A Comment

Your email address will not be published. Required fields are marked (required):

Related articles

Back to Top