Controlling timeline of an instance

Hello!

I have a MovieClip that’s called ‘enemy1’. It is using a class called ‘Enemy’. Is it possible to control my enemy1 MovieClip’s timeline from the Enemy class?

For example I want to run an if check and see if current frame inside my MovieClip is currently 15. (I have animation inside my MovieClips)

When I do something like this inside Enemy.as:


if(this.currentFrame == 15)
{
	this.stop();	
}

I get error messages like:
Line 27 1119: Access of possibly undefined property currentFrame through a reference with static type Enemy.
Line 29 1061: Call to a possibly undefined method stop through a reference with static type Enemy.

Could someone please help me figure this out?