Hey there, does anybody know why my image won’t load when I have it’s class referenced from the document class rather that being in the document class?
This produces no errors and the second class traces the note, but it doesn’t load the image.
// ----- Main Class
package {
import flash.display.Sprite;
public class Main extends Sprite {
public function Main() {
var art:Art = new Art();
}
}
}
// ----- Art Class
package {
import flash.display.Sprite;
import flash.display.Loader;
import flash.net.URLRequest;
public class Art extends Sprite {
public function Art() {
var loader:Loader = new Loader()
loader.load(new URLRequest("../assets/art/screens/title-page-small.jpg"));
addChild(loader);
note();
}
private function note():void { trace ("Hello from the Art class"); }
}
}