SWFLoader Magic
SWFLoader Magic, Posted in Actionscript 3, September 11th, 2008

I just wanted to make a quick point.  If you ever find yourself requiring the ability to add a NON UIComponent/IUIComponent DisplayObject on the stage in Flex.  You can simply use a SWFLoader instance because it does not force UIComponent/IUIComponent type checking.

Below is a example I setup to load Image data as a Image as Class but this could be anything, Sprite, MovieClip, etc.

?View Code ACTIONSCRIPT
1
2
3
4
5
[Embed(source="images/myimage.jpg", mimeType="image/jpeg")]
public var tileExample:Class;
var loader3:SWFLoader = new SWFLoader();
loader3.addChild( new tileExample() );
loader3.y = 550; this.addChild( loader3 );