View Single Post
Old 01-20-2012, 03:13 PM   PM User | #2
adaminaudio
New Coder

 
Join Date: Jan 2012
Location: Columbus, Ohio, U.S.A
Posts: 41
Thanks: 0
Thanked 8 Times in 8 Posts
adaminaudio is an unknown quantity at this point
Hi there, yeah the console is telling you that the 'load()' method doesn't exist for the image class.

What you should try to do instead is put it in a Loader object and when the image loads, you make the image source the content of the loader:


Code:
//get your loader ready...
private function init(){
var imageLoader:Loader = new Loader();
imageLoader.loaderInfo.addEventListener(Event.COMPLETE, onImageLoaded);
var req:URLRequest = new URLRequest('assets/' + pictures[index]);
imageLoader.load(new URLRequest('assets/' + pictures[index]);
}


//don't forget to add your handler (for the complete event when the image is finished loading)
private function onImageLoaded(event:Event):void
{

   //I could have this part wrong, can't remember now :)
  image.source = event.target.content;  
   
}

I hope that helps!

-Adam
adaminaudio is offline   Reply With Quote