That's close to the truth, I think. As a colleague of mine pointed out, objects on frame1 were already initialized before the constructor is executed while objects on another frame need some time (usually 1 frame) to become initialized as well.
So my solution will be to avoid gotoAndStops as much I can and work with single frame symbols. Matthias 2007/11/21, Alex Harui <[EMAIL PROTECTED]>: > > I'm pretty sure that gotoandplay just advances the playhead and doesn't > execute the script on that frame until your script finishes so the widgets > it creates won't be ready right after the call. > > > ------------------------------ > > *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On > Behalf Of *Matthias Dittgen > *Sent:* Wednesday, November 21, 2007 8:13 AM > *To:* flexcoders@yahoogroups.com > *Subject:* [flexcoders] getDefinitionByName and gotoAndPlay > > > > Hello, > > I am loading a SWF into my application, which I created in FlashCS3. > I have exported MovieClips with timeline animation and textfield, etc. > for AS in my library. > > After loading of the SWF is complete I get the Class like this: > var MyClass:Class = getDefinitionByName("MyClass") as Class; > > Then I create a MovieClip instance an add it to stage, like this: > var mc:MovieClip = new MyClass() as MovieClip; > addChild(mc); > > this works great, but when I want to gotoAndPlay() to another frame an > change the content of a Textfield there, then the Textfield is null > and it takes some time (Timer or Enterframe script) to wait for the > Textfield being not null. > > Can someone imagine why? > Matthias > > >