I'm trying to load a group of images into a scrollpane component with XML. So far, I can get them all to load in a movieclip outside the scrollpane, but how do I put that movieclip inside the scrollpane??
------------------------------------------------
galleryXML = new XML();
galleryXML.onLoad = init;
galleryXML.load("stencils.xml");
galleryXML.ignoreWhite = true;
var xPos:Number = 0;
var yPos:Number = 0;
var my_mcl:MovieClipLoader = new MovieClipLoader();
function init(success) {
if (success == true) {
imgDesc = "";
rootNode = galleryXML.firstChild;
nbrImages = rootNode.childNodes.length;
image = rootNode.firstChild;
for (i=0; i<nbrImages; i++) {
mcName = "mc_"+i;
loadImage(image.attributes.swfURL, mcName, image.firstChild.nodeValue, i+1);
image = image.nextSibling;
}
}
}
function loadImage(imgSrc, clipName, desc, ctr) {
//Creates a parent movie clip to hold the container
this.createEmptyMovieClip("parent", this.getNextHighestDepth());
newClip = parent.createEmptyMovieClip(clipName, this.getNextHighestDepth());
//this is the movie clip the image will replace
newClip.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
//use moviecliploader to load the image
my_mcl.loadClip(imgSrc, newClip.container_mc);
newClip._y = yPos;
newClip._x = xPos;
if (ctr%10 == 0) {
xPos = 0;
yPos += 30;
} else {
xPos += 30;
}
newClip.onRollOver = function () { imgDesc = desc;};
}
------------------------------------------------
galleryXML = new XML();
galleryXML.onLoad = init;
galleryXML.load("stencils.xml");
galleryXML.ignoreWhite = true;
var xPos:Number = 0;
var yPos:Number = 0;
var my_mcl:MovieClipLoader = new MovieClipLoader();
function init(success) {
if (success == true) {
imgDesc = "";
rootNode = galleryXML.firstChild;
nbrImages = rootNode.childNodes.length;
image = rootNode.firstChild;
for (i=0; i<nbrImages; i++) {
mcName = "mc_"+i;
loadImage(image.attributes.swfURL, mcName, image.firstChild.nodeValue, i+1);
image = image.nextSibling;
}
}
}
function loadImage(imgSrc, clipName, desc, ctr) {
//Creates a parent movie clip to hold the container
this.createEmptyMovieClip("parent", this.getNextHighestDepth());
newClip = parent.createEmptyMovieClip(clipName, this.getNextHighestDepth());
//this is the movie clip the image will replace
newClip.createEmptyMovieClip("container_mc", this.getNextHighestDepth());
//use moviecliploader to load the image
my_mcl.loadClip(imgSrc, newClip.container_mc);
newClip._y = yPos;
newClip._x = xPos;
if (ctr%10 == 0) {
xPos = 0;
yPos += 30;
} else {
xPos += 30;
}
newClip.onRollOver = function () { imgDesc = desc;};
}