I'm looping through all the items of my XML and use LoaderMax to load my SWFs onto stage, and trigger a function to generate video items and text items.
This looks like this:
for each (var item in Main.XMLLiveItems.items.*) {
if (item.@type == "static") {
Main.queue.insert(new SWFLoader("media/"+item.@name, {
name:item.@id,
container:area,
alpha: 0,
onComplete: itemLoaded
}),item.@level);
} else if (item.@type == "text") {
createTextAsset(item);
} else if (item.@type == "video") {
createVideoAsset(item);
}
}
However, this messes up the levels since LoaderMax loads the queue after my textassets and videos have been loaded onto stage. I can't add the text assets or the video assets to my stage (called area) when specifying the index, because the number of children is still zero when the createTextAsset and createVideoAsset functions are called.
I've tried to first use 'applyFullXML' and then add the textfields and videoloaders as a child to the placeholders. This turned out the way I wanted, except the textfields did not scale properly (using the scaleWidthAndHeight property) since they were now a child of a sprite.
I am currently not sure what to do so was hoping for a push in the right direction.
Thanks again.