I have a dynamic TextField on a seperate layer so it appears in the frames I want. I can access the object from AS 3 and changes its text without a problem. Once the frames changes from 3->4->3 I can no longer access it. I get a null error.
I'm making the change in another class:
(root as MovieClip).lblScore.text = this.score.toString();
If I look at root it shows that lblScore is null. This same line excutes fine prior to the frames changing.
that textfield no longer exits on frame 4.
to fix that, make the needed changes to ensure your frame 3 textfield is NOT in a frame 4 keyframe. once you've done that, you can add a keyframe at frame 4 that contains your textfield and make whatever changes you need (except you can't remove and readd the textfield or change its instance name).
I'm changing the text field from another class that was created in frame 3. I pass the root to this class and then use the code I posted to change it. It works fine the first time its called but once I got to frame 4 and back to frame 3 and the same class tries to change it, it throws the exception.
The text for the text field. I did get this to work by removing frame 4 and then adding a new keyframe to it. But for some reason it stopped working. I tried the same steps again. I right click on frame 4 and choose Remove frames. Now that there is no frame in frame 4 I right click the frame and choose Insert Keyframe but it still doesn't work.
The value is set and displayed in frame 3, it changes to frame 4 and the value is gone. It goes back to frame 3 and the value is still gone.