Hello, I have a bit of a problem.
I have started on an AS file to get images from an XML document and then add them to separate movieclips (or any other bitmap holder) so that I can then manipulate them separately.
My problem is that I cannot get them into seperate movieclips, I don’t know which way to go about it. For example, once I have got the urls to the images from the XML file, I put them into an array using a for(){} loop, but after that I don’t know how to put them into seperate movieclips or sprites.
Here is the function that puts the urls into an array:
public function loadImage(xml:XML)
{
var btnLoader:Loader = new Loader();
_btnArray.length = 3;
for(var i = 0;i<3;i++)
{
_btnArray* = xml.child("btn").attribute("href")*;
trace(_btnArray*);
}
}
I tried creating a new movieclip inside the for loop and adding the image to it:
btnLoader.load(new URLRequest(_btnArray*));
var btn:MovieClip = new MovieClip();
btn.addChild(btnLoader);
But this obviously meant, for each time, the new image was being loaded into the same MovieClip called “btn”. Therefore I could not manipulate the images separately.
My question is; How do I add the images to separate MovieClips or Sprites etc?
Thanks for your time,
Blekk.