[RESOLVED] Load external images from as class
I cannot seem to "convert" the loadImage into a dynamic field. I am making an mp3 player and have added a cover art portion, I can only figure out how to call a single static image. However I want to to be able to call from this image from my xml file:
items[currentID].art
Here is the original single static image loading code.
Actionscript Code:
var tSm:String = "easeOutElastic";
var tIm:Number = 2;
var imageLoader:Loader;
function loadImage(Iurl:String):void
{
// Set properties on my Loader object
imageLoader = new Loader();
imageLoader.load(new URLRequest(Iurl));
imageLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, imageLoading);
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
}
loadImage("asset/Give Up.jpg");
function imageLoaded(e:Event):void
{
// Load Image
spectrumArea.coverArt.albumArt.addChild(imageLoader);
spectrumArea.coverArt.bufferClip.visible = false;
Tweener.addTween(spectrumArea.coverArt.albumArt, {width:64, time:tIm, transition:tSm});
Tweener.addTween(spectrumArea.coverArt.albumArt, {height:64, time:tIm, transition:tSm});
}
function imageLoading(e:ProgressEvent):void
{
spectrumArea.coverArt.bufferClip.visible = true;
}
Please help. :confused: