adspace
Answer Posted / Ritesh
To display a JPG image in a Dynamic Text Field, you first need to load the image using the URLLoader class. After loading, you convert the byte array into a Bitmap object and add it as the texture of the Dynamic Text Field. Here's an example code snippet:
var loader:URLLoader = new URLLoader(new URLRequest('image.jpg'));
loader.load();
loader.addEventListener(Event.COMPLETE, loadHandler);
function loadHandler(event:Event):void {
var ba:ByteArray = event.target.data as ByteArray;
var bm:Bitmap = Bitmap(ba);
dynamicText.texture = bm;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category