How to add MovieClip (Image) to TextField in Action script 3 Flash Professional CS6

In action script 3 adding images and movie clips to the TextField very easy using <img> tag and htmlText property of TextField. Just follow few steps to add images or movieclips to the TextField.

step 1: Initialize TextField instance using TextField Class, and assign font, text size and color to the TextField using TextFormat Class.

Step 2: Now add image or movie clip to TextField using <img> tag by referring image name in src property of the  <img> tag.

<img src=’eye.jpg’ width=’190′ height=’200′>

example.

var img:String= “<img src=’eye.jpg’ width=’190′ height=’200′><br/’><p> This is nice photograph</p> “;
txt_field.htmlText=img;

Note: If you want to add movie Clip to text field just mention movieclip name in the src property of the <img> tag. Like if you have MovieClip named car just refer that MovieClip like below

<img src=’car’ width=’190′ height=’200′>

How to add MovieClip (Image) to TextField in Action script 3 Flash Professional CS6

 

Posted by:

muni

Related articles

Back to Top