Only UIComponents (or IUIComponents) can be added as a child to Containers.
Loader is not a UIComponent and I assume "this" is the Application and thus
a Container.  You're either going to need to add the Loader to a UIComponent
and add that component to the application, or you can use
mx.controls.SWFLoader, which is similar to the Loader but a UIComponent.

- Daniel Freiman
nondocs? <http://nodocs.blogspot.com>

On 10 Apr 2007 00:25:43 -0700, ronnlixx <[EMAIL PROTECTED]> wrote:

  I'm trying this example from the documentation:

var pictLdr:Loader = new Loader();
var pictURL:String = "banana.jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
this.addChild(pictLdr);

I'm trying it in my creationComplete callback and get this error:

cannot coerce the Loader into an IUIComponent.

What am I doing wrong here?

Reply via email to