Declare a variable to hold the counter value and in the desired frame increment it by 1.
// frame 1:
// desired frame
Alright, so... how can I use this to change the value in a dynamic text box? And is this code going on the layer with the text box, or on another layer?
yourTextField.text = counter.toString();
The usual convention when using frame scripts is to put them in a separate layer.