1 Reply Latest reply on Jul 18, 2011 12:06 AM by Flex harUI

    Unable to switch between viewstack's children




      I have a Viewstack with 2 containers:


      <mx:ViewStack id="preFeatureViewStack" selectedIndex="{model.viewStackIndexPublicAccess}">

      <s:NavigatorContent id="prefNav1" width="100%" height="100%">

      <view:PreferredFeature />


      <s:NavigatorContent id="prefNav2" width="100%" height="100%">

      <view:UpdateFeatureLabel />




      The selectedIndex property of Viewstack is bound to a variable, viewStackIndex, in my PresenationModel. I have getters and setters defined for this property.


      In PM :


      private var viewStackIndex : int;



      public function get viewStackIndexPublicAccess () : int {

      Alert.show("in getter");

      return viewStackIndex;



      public function set viewStackIndexPublicAccess (viewId : int) : void {

      Alert.show("in setter");

      if(viewStackIndex != viewId) {

      Alert.show("old value = " + viewStackIndex);

      viewStackIndex = viewId;

      Alert.show("new value = " + viewStackIndex);

      dispatcher.dispatchEvent(new Event("viewStackIndexChange"));




      I am not able to switch between the viewstack's containers. Any ideas ?