This content has been marked as final. Show 3 replies
use the loader class to load your jpg and use the addChildAt() method of the displayobjectcontainer to add the loader/jpg to depth 0. if you want to replace whatever was previously at depth 0, use the removeChildAt() method.
I've got it the jpg loading functionality working the first time. It's replacing it that is a problem.
I was hoping there was some way to conditionally test if an image was at a level so that on first load it does one set of instructions and on the subsequent loads, it will remove the child from the display list and replace the image with the new one.
For now, I have two functions. When the class is instantiated, it does the first function and on subsequent loads, the second function is used. If you can come up with a better way kglad, by all means, let me know.
if there are no other children of the displayobjectcontainer you can use its numChildren property to determine whether this is the first child added or a subsequent one.