# Error when i moved an object in new frame

**URL:** <https://forum.kirupa.com/t/error-when-i-moved-an-object-in-new-frame/272685>\
**Category:** Uncategorized\
**Created:** [October 7, 2008, 5:15pm UTC](https://forum.kirupa.com/t/error-when-i-moved-an-object-in-new-frame/272685 "2008-10-07T17:15:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![zoink](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@zoink](https://forum.kirupa.com/u/zoink)\
**Post date:** [October 7, 2008, 5:15pm UTC](https://forum.kirupa.com/t/error-when-i-moved-an-object-in-new-frame/272685/1 "2008-10-07T17:15:50Z")

</div>

I am practicing with my actionscript and encountered a problem… Previously, my main movieclip has only 1 frame with 2 layers. I have a dynamic textfield (myText\_txt) already in the stage in frame 1.

in my actions page, i have myText\_txt.text = “hello”.

Then, i decided to move all of the stuff from my frame 1 into frame 2. Suddenly, flash cant detect myText\_txt anymore… Cannot access a property or method of a null object reference.

my actions page looks something like this now:

function initialize():void  
{  
this.stop();  
this.gotoAndStop(2);  
myFunction();  
}

function myFunction():void  
{  
myText\_txt.text = “hello”  
}

initialize();

Why is this? i extended my very first layer which is my action layer all the way to layer 10… dunno if this is required though. But still doesnt work. Why can’t flash detect my myText\_txt? Oh, in the new frame 1, myText\_txt is not yet in the stage.
