Hey
In draw method I dont think Type Casting (as Sprite) is required. Draw
method intakes IBitmapDrawable as an argument.
And I never used like that so I'm not sure of it.
Anyways try the sample code, same as urs, but haven't used Type
Casting
<?xml version="1.0"?>
layout="absolute">
<mx:Script>
<![CDATA[
import mx.controls.Image;
import flash.display.Bitmap;
private function draw():void{
var color:BitmapData = new BitmapData(mySource.contentWidth,
mySource.contentHeight);
//Filling bitmap with target canvas, Here I dont think type casting
[as Sprite] is required.
color.draw(myCanvas);
var myImage:Image = new Image();
myImage.source = new Bitmap(color);
board.addChild(myImage);
}
]]>
</mx:Script>
<mx:Canvas x="10" y="10" id="myCanvas">
<mx:Image width="320" height="240" x="0" y="0" id="mySource"
source="test.jpg" click="draw()"/>
</mx:Canvas>
<mx:Canvas x="340" y="10" width="320" height="240" id="board"/>
</mx:Application>
Bobbyinsane
http://www.insanepixel.com