Hi!
I have a Image and a RenderTexture-variable.
I’m loading SWF’s dynamically and once they are loaded I want to use the RenderTextures draw-function to draw the SWFs content into the Image variable.
Here is the code of the completeEvent of the loader:
private function swfLoaded(e:LoaderEvent):void {
var spr:Sprite = e.currentTarget.content as Sprite;
renderTexture.draw(spr, 1);
}
.
This is resulting in a #1034 error - Type Coercion, because renderTexture is looking for a starling.display.DisplayObject-variable and e.currentTarget.content is a flash.display.DisplayObject.
Is there some way to “convert” the SWF’s content *(flash displayObject to Starling displayObject) *so I can use it as a texture?
Thanks in advance,
Tompa