# When do movie clip classes become usable?

**URL:** <https://forum.kirupa.com/t/when-do-movie-clip-classes-become-usable/254402>\
**Category:** flash\
**Created:** [March 11, 2008, 5:36pm UTC](https://forum.kirupa.com/t/when-do-movie-clip-classes-become-usable/254402 "2008-03-11T17:36:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZenBlender](https://avatars.discourse-cdn.com/v4/letter/z/a4c791/32.png) [@ZenBlender](https://forum.kirupa.com/u/ZenBlender)\
**Post date:** [March 11, 2008, 5:36pm UTC](https://forum.kirupa.com/t/when-do-movie-clip-classes-become-usable/254402/1 "2008-03-11T17:36:49Z")

</div>

Often I have this problem:

Within a script, I move to a keyframe where a movie clip exists. The movie clip is attached to an Actionscript 2.0 class. Once the movie clip exists, I want to be able to give it some initialization settings, but it seems they are not available until the next frame. For example, let’s say in a script I say:

```auto
gotoAndPlay(5);
the_object.init("test");

```

On frame 5, a movie clip the\_class is placed (instance name “the\_object”), and its associated class looks like this:

```auto
class the_class extends MovieClip{
  public function init(str:String):Void{
    trace("initializing with string "+str);
  }
}

```

It appears that in my first script, you must WAIT until the next frame until the class code of an object you have just created becomes accessible. The trace() statement does not fire! How can I get around this problem without some annoying workaround where I have to display objects, then wait until the next frame before interacting with them? (I’m exporting as Flash 8 and using Actionscript 2.0)

Thanks!
