if (goblin.hitTestPoint(character.aMode.lance.x, character.aMode.lance.x, true))
{
trace("goblin been hit, please minus one life");
}
This is the code and the error is:
1119: Access of possibly undefined property aMode through a reference with static type player.
This is how I set my code
public static var character:player;
character = new player;
container.addChild(character);
character was dynamically added to container. In character there are four frames, the third frame contains a movieclip and it's called "aMode" in the instance name. Inside the movie clip, there is another movieclip called Lance, with the instance name of "lance".
In As2 I'm sure this would work.
I think the problem is that since aMode isn't on the first frame, character.aMode(should be in the first frame) in order for it to work.
or perhaps it's not added to the display list, but flash should automatically add it to the display list, right?
Sorry if it's too much.
Here is a picture for visual aid.
you can see that this aMode movievlip is in a different frame within the character movieclip (which was added dynamically)