you could also listen for state change events and call the creation
complete event manually.

<s:SomeMXMLComponent stateChange="someComp.creationComplete(event)"
id="someComp" includeIn="someState" />

On Jul 25, 2016 1:46 AM, "Alex Harui" <aha...@adobe.com> wrote:



On 7/24/16, 8:55 PM, "bilbosax" <waspenc...@comcast.net> wrote:

>Surely there is a more straight forward approach that I am
>not familiar with?
>

Well, there is using a bit more ActionScript.  Instead of declaring an
MXML component in our MXML, instantiate it in ActionScript.

IOW, instead of:

<s:Application>
  <s:Button click-"currentState='someState' />
  <s:SomeMXMLComponent id="someComp" includeIn="someState" />
</s:Application>

You can do something like this:

<s:Application>
  <s:Button click-"currentState='someState'; someComp = new
SomeMXMLComponent(); addElement(someComp);" />
</s:Application>


Some other code that switches away from someState would call
removeElement(someComp) and someComp = null;

As long as SomeMXMLComp doesn't have any other references to it, it would
go away.

HTH,
-Alex

Reply via email to