How can you show a jpg image in dynamic text field?



How can you show a jpg image in dynamic text field?..

Answer / 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

More Multimedia General Interview Questions

How can you show a jpg image in dynamic text field?

1 Answers  


What are the common multimedia file formats?

1 Answers  


What is interface in term of oop (flash actionscript)?

1 Answers  


When I set visible=”false”, the component still takes up space and appears in the tab order. Why is that?

1 Answers  


How controlling happen in DLNA?

1 Answers   Sony,


How are projector lumens measured?

1 Answers  


Differences between defining bindings in mxml and actionscript?

1 Answers  


Define midi?

1 Answers  


Write a C language program to perform CCITT group 3 compression. If possible, scan some images and use your program to compress the images. What kind of compression did you achieve?

0 Answers  


How do I change divx to vob?

1 Answers  


Explain what is graphics?

1 Answers  


How do I change my home page?

1 Answers  


Categories