|
If you feel that it is important to
separate MXML and ActionScript, I suggesting writing MXML event attributes like
this <mx:Button id="okButton"
label="OK" click="okButton_click(event)"/> and then implementing okButton_click() in
a separate .AS file that you bring in using <mx:Script source="MyApp.script.as"/> That way, the MXML doesn't really do
anything; it just makes sure that the appropriate AS event handler gets set up. I can also think of two other ways to
solve your problem, but I don't recommend either one. You could set
creationPolicy="all" on the ViewStack. But this will defeat the
purpose of MXML's "deferred instantiation" feature, which is to
minimize startup time by not creating visual components (such as the children
of the 2nd pane of an ViewStack) until they need to be displayed. You could also override childrenCreated()
in each ViewStack pane and, after calling childrenCreated(), use
addEventListener() to attach your event handlers to that pane's children. - Gordon From: Thanks Gordon! Sometimes I don’t see the
easiest solution by myself! However I’m trying to keep MXML code and
functionality code separate so I’m wondering if there is another workaround
for this? Though I can live with your suggestion in this situation. Sascha From: Why call addEventListener( - Gordon From: Hi list, ___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___ |

