I'm looking to get some advice about what is best practice in terms of
adding content to the display list.

I have a Loader object that I reuse. I load a SWF and when the
complete event fires I add the Loader.content to the display list (the
stage's display list).

The problem I've run into is that if I try to call Loader.unload() or
Loader.load() again on the same Loader object, I get a runtime error:
Error #2025 The supplied DisplayObject must be a child of the caller.

If I add the Loader object itself to the display list I don't get that
error and can load and unload content all day.

So, it would seem that it's best to add the Loader to the display list.

However, this presents a question about what the loaded SWF is
expecting. When adding the content to the display list the parent
property of the loaded SWF is the Stage object (in my case). When
adding the Loader to the display list the parent property is the
Loader object.

Does either scenario break anyone's code? Does anyone write code that
depends on the parent property? If so, what is Adobe's recommendation
on this?

The docs have an example of both ways of adding an item to the display list:
http://livedocs.adobe.com/flex/201/html/05_Display_Programming_162_09.html#155572

-- 

Derek Vadneau

Reply via email to