I have a main .fla file that has a movieclip with an instance name level. Within this there is another movieclip called hero.
I have a main class with the following function:
I then have a Hero class with the following code:public function beginLevel() {
var cHero:Hero = new Hero;
createFunction1();
}
In the main flash file, the hero movieclip is nested inside the level movieclip.public class Hero extends MovieClip {
private var hero:Object;
public function createHero() {
hero = new Object();
hero.mc = level.hero;
hero.startx = hero.mc.x;
hero.starty = hero.mc.y;
}
}
The line hero.mc = level.hero; is used to make it easier for me to manipulate the hero's attributes later on. However when I compile this, I get the error message: Access of undefined property level.
I'm not really sure how to get this class file to recognise the movieclips in the main flash file.
Any help would be greatly appreciated.


Reply With Quote
