flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kessler CTR Mark J <mark.kessler....@usmc.mil>
Subject RE: How Should I Dynamically Switch Component?
Date Tue, 14 Oct 2014 11:11:39 GMT
Great, glad it's working.

-Mark

-----Original Message-----
From: Tintin [mailto:1955.mille.miglia@googlemail.com]
Sent: Tuesday, October 14, 2014 6:03 AM
To: users@flex.apache.org
Subject: RE: How Should I Dynamically Switch Component?

Hello Mark

Ok I have got it working with a very neat and simple solution.

In my MXML component I call a function in my 'Presenter' from the
onCreationComplete event:



In my ActionScript class I get a reference to the currentTarget, using the
event argument, and set a variable:



Now I can simply change the 'currentState' property of my _view property
like this:



Back in the View MXML component the 'includeIn' properties now cause the
different components to appear or not depending on the currentState of my
_view property.

It works a treat!



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/How-Should-I-Dynamically-Switch-Component-tp8378p8399.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Mime
View raw message