# Stage text field access from class

**URL:** <https://forum.kirupa.com/t/stage-text-field-access-from-class/282488>\
**Category:** Uncategorized\
**Created:** [February 22, 2009, 9:28pm UTC](https://forum.kirupa.com/t/stage-text-field-access-from-class/282488 "2009-02-22T21:28:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryrocks](https://avatars.discourse-cdn.com/v4/letter/r/ba9def/32.png) [@ryrocks](https://forum.kirupa.com/u/ryrocks)\
**Post date:** [February 22, 2009, 9:28pm UTC](https://forum.kirupa.com/t/stage-text-field-access-from-class/282488/1 "2009-02-22T21:28:05Z")

</div>

Hey,  
A simple access from class question:

I have a dynamic text field on my stage, instance name: “lives\_txt”  
I want to populate this field from my Document class “Ball.as”

So in my Ball.as class I have tried: parent.lives\_txt.text = String (lives);  
where: public var lives:int = 3;

I get an error: access of possibily undefined property lives\_mc through a reference with static type flash.display:DisplayObjectContainer.

What am I doing wrong?

Thanks
