I am new to adobe flash cs6 and actionscript and am having trouble doing what should be a simple task. I have created a new project and document class that looks like this:
package {
import flash.display.MovieClip;
public class MyClass extends MovieClip {
public function MyClass() {
}
}
Now all I want to do is programmatically add an image to the stage when running.
So far, I imported the image to the library which is titled mytestimage which i converted to a symbol. The mytestimage symbol has linkage to a class mytestimage which looks like this:
package {
import flash.display.Sprite;
import flash.events.Event;
public class mytestimage extends Sprite {
public function mytestimage () {
addEventListener(Event.ENTER_FRAME, enterFrame);
}
private function enterFrame(e:Event):void {
}
}
}
I then updated my document class to the following :
package {
import flash.display.MovieClip;
public class MyClass extends MovieClip {
public function MyClass() {
var myMovieClip = new mytestimage();
addChild(myMovieClip);
}
}
and when I debug the project nothing errors and the image isn't loaded - all I see is the white stage. Can somebody help me figure out what I am doing wrong here? Thanks