# How to target class on frame 1?

**URL:** <https://forum.kirupa.com/t/how-to-target-class-on-frame-1/224601>\
**Category:** Uncategorized\
**Created:** [May 3, 2007, 4:24pm UTC](https://forum.kirupa.com/t/how-to-target-class-on-frame-1/224601 "2007-05-03T16:24:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deltajam](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@deltajam](https://forum.kirupa.com/u/deltajam)\
**Post date:** [May 3, 2007, 4:24pm UTC](https://forum.kirupa.com/t/how-to-target-class-on-frame-1/224601/1 "2007-05-03T16:24:55Z")

</div>

Class on frame one:

```auto

var class1:Class1 = new Class1(prop1);

```

After I hae initiated that class, I add some movieclips from the library:

```auto

   var ClassReference = getClass(MC);
   var clip = new ClassReference();
   clip.name = String(MC);
   clip.x = XPos;
   clip.y = YPos;
   clip.alpha = 1;
   //main timeline clip
   var main = this;
 
   main.addChild(clip);
 

```

Attached to ‘clip’ is a class file:

```auto

package classes.com{
 import flash.display.MovieClip;
 import flash.events.Event;
 
 public class Clip extends MovieClip {
  
  public function Clip(){
   trace(parent.class1);
   this.addEventListener("addedToStage", initClip);
  }
  
  private function initClip(evt:Event){
   
  }
 }
}

```

But when I trace “trace(parent.class1);” … I get this error:

```auto

1119: Access of possibly undefined property class1 through a reference with static type flash.display:DisplayObjectContainer.

```

Any ideas? I’m slowly moving through the new AS3, and I run through a few snags here and there. I appreciate any help!

Thanks!
