views:

280

answers:

2

I need to send a picture to flash with external interface (as3)... can not be an url because don't have connection... I'm trying open the image file and send to flash like text but without success

any idea?

A: 

Try to provide more details. What exactly should open image file? Actually, flash itself can open image file from HDD.

var ldr:Loader = new Loader();
ldr.load(new URLRequest('C:/Images/MyImage.jpg'));
addChild(ldr);

But if I understand your trouble - that possibly is not a solution? Is it?

Jet
A: 

Short answer is: Please don't do that.

If you have to, then you'll need to take the image data, encode it with something HTTP request safe like base64, decode it in flash, drop it in a bytearray and remake a Bitmap out of it. This is pretty complicated.

http://dynamicflash.com/goodies/base64/ is a great class for decoding your base64 image string into a bytearray.

UltimateBrent