billy nugz
June 2nd, 2008, 02:10 PM
Hey guys I would like to know how to load a image into a movie clip via xml. I just need a list of images within the xml to load into different movieClips.
I have been able to use this in the past but now I need to tie it to xml and have no idea how.
var imageLoader:Loader;
function loadImage(url:String):void {
// Set properties on my Loader object
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(Pro gressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, imageLoaded);
}
loadImage("pixelHouses.jpg");
function imageLoaded(e:Event):void {
// Load Image
imageArea.addChild(imageLoader);
}
function imageLoading(e:ProgressEvent):void {
// Use it to get current download progress
// Hint: You could tie the values to a preloader :)
}
Any help would be great, and any advice on how to tie this to a visible preloaded would be icing on the cake. Thanks for all and any help guys.
I have been able to use this in the past but now I need to tie it to xml and have no idea how.
var imageLoader:Loader;
function loadImage(url:String):void {
// Set properties on my Loader object
imageLoader = new Loader();
imageLoader.load(new URLRequest(url));
imageLoader.contentLoaderInfo.addEventListener(Pro gressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Eve nt.COMPLETE, imageLoaded);
}
loadImage("pixelHouses.jpg");
function imageLoaded(e:Event):void {
// Load Image
imageArea.addChild(imageLoader);
}
function imageLoading(e:ProgressEvent):void {
// Use it to get current download progress
// Hint: You could tie the values to a preloader :)
}
Any help would be great, and any advice on how to tie this to a visible preloaded would be icing on the cake. Thanks for all and any help guys.