8 Replies Latest reply on May 23, 2009 5:14 AM by Michael Borbor

    Forcing instant component creation (thus 'creationComplete' will be called).

    Lopo Nopo Level 1

      Hello, me again with one more question:

       

      From what I can see, when I do something like this:

       

      var component_instance:ComponentName = new ComponentNam();

       

      .. no child controls created, correct?

       

      So, I set to this component (and it's parent by the way, which does NOT inherit correctly) the "creationPolicy" to "all".

      Yet, it seems like declaring this "new" statement doesn't make the component create any child components.

       

      So on it's parent (the application) I "addChild(component_instance)".

      Now only some of the components are created.

      There are components which are created only in a certain state, and even though the initial state is set to, for example "startState", these components are not created.

       

      Anyway I look at it, the only way to get it done is not to wait for the creationComplete event to be executed some time in the near future but to execute it (actually the whole initialization chain) immediately after the "new ComponentNam()" call.

       

      Please advise gurus.