PDA

View Full Version : I can draw curves on PNG but not on SWF


bjornbjorn
02-08-2007, 08:32 AM
Hi guys - I've got a problem which I hope to get some help on here:

I have an MXML component which loads a background. It contains a canvas which contains an SWFLoader like this:

<mx:SWFLoader id="theImage" source="http://juicability.com/stream_media.php?file=file.png" scaleContent="true" />

If I load a png (like in the example above) I'm able to draw curves on it. But if I loade file.swf (which is identical, only it's a .swf) the curves does not show.

I use Alex Uhlmann's animationpackage (http://www.alex-uhlmann.de/flash/animationpackage/) for AS3 to do the painting.

This is done by getting the SWFLoader reference from my component and then doing a swfloader.addChild( targetSprite ) - where targetSprite has a QuadCurve.

I guess I'm a bit confused as how to do this best. I know Spirtes cannot be added directly to flex components since they do not extend UIComponent or implement IUIComponent - but it's strange that this works when I load an image but not a swf ..

Any pointers appreciated! :)

dr_zeus
02-08-2007, 05:40 PM
If I load a png (like in the example above) I'm able to draw curves on it. But if I loade file.swf (which is identical, only it's a .swf) the curves does not show.

Is it a Flash 8 or lower SWF? That could be the cause...

I guess I'm a bit confused as how to do this best. I know Spirtes cannot be added directly to flex components since they do not extend UIComponent or implement IUIComponent

Sprites can be added to regular UIComponents, but they cannot be added to Containers (without a little hacking).