Answered
loading a movieClip from a class
Hello all,
I'm attempting to write an AS 2.0 class using Flash through which I can load and control multiple movie clips in the library and from external files. I've attempted multiple different ways, don't quite seem to be able to get the images to show up on the screen. After some time searching, I've been unable to find a good example online. Please excuse my inexperience with AS classes.
I'd like to write a class that extends MovieClip and is used to control multiple 'sub' movieClips, all from methods inside the instantiated class.
From .fla file, I call instantiate my class as follows:
var theScene:sphere3D = new sphere3D();
In the constructor of my class file, I'm attempting to attach or load a movie. I simply want to get it to show up on the screen, when I test the .fla movie. I've tried using attachMovie and loadMovie with not luck.
dynamic class sphere3D extends MovieClip {
function sphere3D() {
this.attachMovie("shadow","shadow",1); // shadow being a movie clip in the .fla library with linkage
shadow._x = 100;
shadow._y = 100;
this.createEmptyMovieClip ("shadow2", 100);
shadow2._x = 100;
shadow2._y = 100;
shadow2.loadMovie("images/cube.png");
}
}
What am I doing wrong? Suggestions for stuff to test would be welcome.
Thank you,
dana.
I'm attempting to write an AS 2.0 class using Flash through which I can load and control multiple movie clips in the library and from external files. I've attempted multiple different ways, don't quite seem to be able to get the images to show up on the screen. After some time searching, I've been unable to find a good example online. Please excuse my inexperience with AS classes.
I'd like to write a class that extends MovieClip and is used to control multiple 'sub' movieClips, all from methods inside the instantiated class.
From .fla file, I call instantiate my class as follows:
var theScene:sphere3D = new sphere3D();
In the constructor of my class file, I'm attempting to attach or load a movie. I simply want to get it to show up on the screen, when I test the .fla movie. I've tried using attachMovie and loadMovie with not luck.
dynamic class sphere3D extends MovieClip {
function sphere3D() {
this.attachMovie("shadow","shadow",1); // shadow being a movie clip in the .fla library with linkage
shadow._x = 100;
shadow._y = 100;
this.createEmptyMovieClip ("shadow2", 100);
shadow2._x = 100;
shadow2._y = 100;
shadow2.loadMovie("images/cube.png");
}
}
What am I doing wrong? Suggestions for stuff to test would be welcome.
Thank you,
dana.
