Progress of a movie (not a preloader)

I am simply trying to display the frame number of a movie as it plays.

I have a dynamic text box with a var(iable) called framenum. I use an off stage movie clip with the following code attatched to the movieclip:

onClipEvent (enterFrame) {
framenum = _currentframe;

(I believe that you don’t need to target the movieclip if the code is associated with that clip, although I have tried this as well)

Why doesn’t this work please ?



onClipEvent(enterFrame) {
_root.framenum.text = _currentframe


Just to develop a bit mac’s answer:

When you use static event handlers like onClipEvent (enterFrame), the scope of the variables is the clip itself. That’s why when you write _currentframe, what it means really is this._currentframe. Fine. But that’s why it also means that Flash is looking for this.framenum, which obviously doesn’t exist.

So you have to specify the right path to get to the textfield, in this case _parent.framenum, or _root.framenum :wink:

Thanks guys, that’s very helpful.