Add the text dynamically on Image in flex
I want to develop an application in flex 3 in开发者_如何转开发 that application I can add the text dynamically on the image. Also I can able to rotate the text, change the size of text container. Can anyone help me for that?
Pretty easy to do something like this, assuming you know the width/height of your images, you could do something like this:
<mx:Canvas id="myImage" width="<image_width>" height="<image_height>" backgroundImage="<image>" />
Then you can add Text to the canvas:
var t:Text = new Text();
t.text = 'test';
// more stuff (x, y, rotate, etc)
myImage.addChild( t );
Voila!
精彩评论