# Problem With Undefined Property

**URL:** https://forum.kirupa.com/t/problem-with-undefined-property/280662
**Category:** flash
**Created:** [January 30, 2009, 2:40am UTC](https://forum.kirupa.com/t/problem-with-undefined-property/280662 "2009-01-30T02:40:42Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DanDaMan](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DanDaMan](https://forum.kirupa.com/u/DanDaMan)
#### Post date: [January 30, 2009, 2:40am UTC](https://forum.kirupa.com/t/problem-with-undefined-property/280662/1 "2009-01-30T02:40:42Z")

</div>

Hey, I’m having a little trouble with the properties of an instance of a specific class. Here’s and example of the code I am using:

```auto
package {
    import flash.display.MovieClip;
    import flash.events.*;

    public dynamic class Circle1 extends MovieClip {
        private var _root:Object;
        public function Circle1() {
            addEventListener(Event.ADDED_TO_STAGE, beginClass);
            addEventListener(Event.ENTER_FRAME, eFrame);
        }
        private function beginClass(event:Event):void {
            _root=MovieClip(root);
        }
        private function eFrame(event:Event):void {
            this.x=_root.newCircle2.x;
            this.y=_root.newCircle2.x;
    }
}

```

This is in the class code for Circle1. Now here is the error that is being displayed int he Output Box when I try to run the file:

```auto
TypeError: Error #1010: A term is undefined and has no properties.
    at Circle1/eFrame()

```

Here’s the code that creates the two class instances as children on the Main Time Line:

```auto

if (spaceDown) {

        var newCircle1:Circle1=new Circle1();
        addChild(newCircle1);
    }
if (enterDown) {
        var newCircle2:Circle2=new Circle2();
        addChild(newCircle2);
    }

```

enterDown is a defined variable for the key press of Enter, and spaceDown is a defined variable for the key press of Space. Is there something I’m doing wrong here?
