I have Flex application(not AIR) thats load image and perform some effects, application works well in flash builder and in the debug folder. But when I am trying to copy *.swf to another local folder, appears problems with image loading.
Can anybody help me? May be need specify some restriction or rules?
UPDATE You don't understand me, i am trying to load image from desktop using FileReference class, image shows successfully, but origBitmap after saveAsBitmap() method is null
public function loadImage():void
{
fileRef.addEventListener(Event.SELECT, onFileSelected);
var textTypeFilter:FileFilter = new FileFilter("Images (*.jpg, *.jpeg, *.gif,*.png)", "*.jpg; *.jpeg; *.gif; *.png");
fileRef.browse([textTypeFilter]);
}
public function onFileSelected(evt:Event):void
{
fileRef.addEventListener(Event.COMPLETE, onComplete);
fileRef.load();
}
public function onComplete(evt:Event):void
{
byteArr = fileRef.data as ByteArray;
ldr = new Loader();
ldr.loadBytes(byteArr);
fileRef.removeEventListener(Event.SELECT, onFileSelected);
fileRef.removeEventListener(Event.COMPLETE, onComplete);
callLater(show);
}
public function show():void
{
currImg.source = ldr;
callLater(saveAsBitmap);
}
public function saveAsBitmap():void
{
bd = new BitmapData(currImg.contentWidth * currImg.scaleX, currImg.contentHeight * currImg.scaleY,true);
bd.draw(currImg as IBitmapDrawable);
origBitmap = new Bitmap(bd);
}
//.....
<mx:Image id="currImg"/>
//.....