Hi all,
I’m sure this a real noob question but I can’t seem to get this to work. I’m just trying to load an image I know that the variable img_path is being set correctly because of the trace statements, and LittleSnitch tells me that it is connecting to google. but the image will not display.
my class
package com.fieldsofcorn.loaders {
import flash.display.MovieClip;
import flash.display.Loader;
import flash.net.URLRequest;
public class LoadImage extends MovieClip {
private var img_path:String;
public function LoadImage(path) {
trace(path)
this.img_path = path;
init();
} // end constructor
public function init():void {
var loader:Loader = new Loader();
addChild(loader);
trace(this.img_path);
loader.load(new URLRequest(this.img_path));
} // end init
}// end class
} // end package
and this is in the first frame of my movie:
import com.fieldsofcorn.loaders.LoadImage
var img:LoadImage = new LoadImage("http://www.google.com/intl/en_ALL/images/logo.gif");
Any help would be great. My first AS3 project.