Access base class properties from the timeline?

Ah yes, another question. Hopefully one that’s not too hard. Wasn’t able to turn up an accurate answer from searching, so here we go:

I have a linked MovieClip in my library which has an associated base class. Naturally, the base class extends MovieClip.

Inside the MovieClip are some animated timeline thingies. At various points in the animation, I’d like to be able to set a variable that belongs to the item’s base class (it’s been declared, eg. private var isPlaying:Boolean = true;

However, it would seem that from the timeline, all references to anything belonging to the class returns null - eg. trace (isPlaying); from the timeline would throw up an 1120: Term is undefined. If I use magic keyword this.isPlaying, I trace and get “undefined”.

I’m probably missing something basic again, so your patience and help is appreciated :slight_smile:

Are you doing this trace from the same movieclip that has the “isPlaying” variable defined? If not, you won’t be able to access it because you have set it as private. If you want it accessible from other places you need to set it to public, then reference it correctly. For example i believe it is within a movieclip? So you would get it by going <movieClipName>.isPlaying

Aha, yes.

I had a Player movieclip, and its own class, Player.as, that it is linked to.

It seems that the timeline of the movieclip inside the Flash authoring environment is considered to be an external entity, and as such must use all the same public methods as an other interacting element must. That is, I can’t pretend that the timeline is in the same scope as the class itself - it’s a separate scope.

Thanks :slight_smile: