# Progress of a movie (not a preloader)

**URL:** <https://forum.kirupa.com/t/progress-of-a-movie-not-a-preloader/38639>\
**Category:** flash\
**Created:** [December 27, 2003, 9:34am UTC](https://forum.kirupa.com/t/progress-of-a-movie-not-a-preloader/38639 "2003-12-27T09:34:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Geoff](https://avatars.discourse-cdn.com/v4/letter/g/a3d4f5/32.png) [@Geoff](https://forum.kirupa.com/u/Geoff)\
**Post date:** [December 27, 2003, 9:34am UTC](https://forum.kirupa.com/t/progress-of-a-movie-not-a-preloader/38639/1 "2003-12-27T09:34:38Z")

</div>

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 ?

Thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 27, 2003, 10:11am UTC](https://forum.kirupa.com/t/progress-of-a-movie-not-a-preloader/38639/2 "2003-12-27T10:11:44Z")

</div>

[AS]

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

[/AS]

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 27, 2003, 1:11pm UTC](https://forum.kirupa.com/t/progress-of-a-movie-not-a-preloader/38639/3 "2003-12-27T13:11:01Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [December 27, 2003, 5:18pm UTC](https://forum.kirupa.com/t/progress-of-a-movie-not-a-preloader/38639/4 "2003-12-27T17:18:52Z")

</div>

Thanks guys, that’s very helpful.

Geoff
