This content has been marked as final.
Show 4 replies
-
1. Re: Preloading from XML data
Mr_Helpy_mcHelpson Nov 30, 2007 11:29 AM (in response to purple_am)//creates a movieClip to load the image into
var container:MovieClip = createEmptyMovieClip("container", getNextHighestDepth());
//creates a movieClipLoader (to watch the loading for you)
var mcLoader:MovieClipLoader = new MovieClipLoader();
//add a listener to watch the loading
mcLoader.addListener(this);
//loadMovie "YourImage.jpg" into container
mcLoader.loadClip("YourImage.jpg", container);
//once its loaded it will trace for you
function onLoadInit(mc:MovieClip) {
trace("onLoadInit: " + mc);
}
does that help? -
2. Re: Preloading from XML data
purple_am Nov 30, 2007 11:57 PM (in response to purple_am)The code helps for sure ... but instead of creating the movieclip on the fly i want to load it in MCs already on the stage.
I prefer not to create MCs on the fly cause i will be animating them.
-
3. Re: Preloading from XML data
Mr_Helpy_mcHelpson Dec 3, 2007 10:18 AM (in response to purple_am)Just kill "var container ..."
And replace "container" with your mc name (from the stage) in the loadClip() function. -
4. Re: Preloading from XML data
purple_am Dec 5, 2007 2:31 AM (in response to purple_am)well here is what i did
////////////////////////////////////////////////////////////////////////
slideContent = new XML();
slideContent.ignoreWhite = true;
slideContent.load("xml/slideContent.xml");
slideContent.onLoad = function(success) {
image = [];
xmlNode = this.firstChild;
totalNumImages = xmlNode.childNodes.length;
for (i=0; i<totalNumImages; i++) {
image = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
mcLoader.loadClip(image[0],img_right_mc);
mcLoader.loadClip(image[1],slideContainer_mc.slideContent_mc);
}
};
////////////////////////////////////////////////////////////////////////
var mcLoader:MovieClipLoader = new MovieClipLoader();
////////////////////////////////////////////////////////////////////////
mcLoader.addListener(this);
////////////////////////////////////////////////////////////////////////
function onLoadInit(mc:MovieClip) {
gotoAndStop(2);
}
////////////////////////////////////////////////////////////////////////
Its working fine but am not sure if its the right way of coding it.

