I have loaded a SWF which is created in Flash CS9 (AS3). I'm having problem passing Bitmap (or BitmapData) from the flex app to the loaded SWF.
Invoking of other functions in the loaded from Flex works, but when I try to pass a Bitmap to the loaded SWF, nothing happens. Here's a sample code:
FLEX:
try{
var bm:Bitmap = (someEvent.data as Bitmap);
imageHolder.source = bm; // works fine with container inside flex app
flashSWF.setPhotoBitmap(bm);
}catch(e:Error){
tracer("error = "+e);
}
FLASH:
function setPhotoBitmap(b:Bitmap):void{
addChild(b); // throws error
}
The above throws a TypeError: Error #2007 Probably because b is null.
Is there any restriction I should be aware of, or am I doing something wrong here?
Cheers!