Groups | Blog | Home
all groups > flash actionscript > october 2004 >

flash actionscript : i need to align(center) the image in text field



Christin-78
10/1/2004 6:34:55 AM
Patrick Bay
10/1/2004 9:55:29 AM
Hi,

When you create your HTML, add an extra attribute named 'id' in
there. Like this:

<img id='myImage'...

When you load up the text box, your image will now have an instance
name that you can use to manipulate it. Now all you have to do is center
it with respect to the text box. Let's say, for instance, that your text
box has an instance name "textArea". Your code would look like this:

myImage._x=textArea._x+(textArea._width/2) + (textArea._width/2);
myImage._y=textArea._y+(textArea._height/2) + (textArea._height/2);

Regards,
Patrick

-----------------------------------------------------
www.baynewmedia.com

IRC (www.dal.net) -> #baynewmedia
-----------------------------------------------------



[quoted text, click to view]
Jon Moyles
10/1/2004 4:42:20 PM
does the smiley face have to be in the text box?
could it go on top?
then you could say:

mySmileyFace._x = mtTextBox._x + (mtTextBox._width / 2);

Christin-78
10/2/2004 10:48:54 AM
Ok thanks but i think this is not solution cause i have to paste the image anywhere I want after the text like
AddThis Social Bookmark Button