I have a view stack setup as a custom component, in it there is a
property call displaySection which is an int that corresponds to the
index to set the view stack. This is so that I can then use constants
for each of the sections external to the view and not worry about the
implementation within the view.

It is something like follows:

<mx:Viewstack 
   ...
   selectedIndex="{displaySection}">

   ...
   public static const SECTION_ONE:int = 0;
   (etc.)
   ...

   [Bindable]
   public var displaySection:int = SECTION_ONE;
   ...
</mx:Viewstack>

If I then change the displaySection externally and trace out the
selectedIndex and selectedChild of my component both are as expected,
however the very first time I do this without fail the display does
not change and the section displayed is always the default one.
However if I try and do it again then everything works fine.

I've tried swapping out the displaySection variable for a setter and
removed the binding and made the selectedIndex/selectedChild change
happen within commitProperties() and have traced out the initialized
property of my view and the length of the children and everything is
always as I expect it to be. However still no matter what I try
without fail on the first attempt to change the displaySection it
never works (always does thereafter --- but with nothing discernibly
different in the trace).

I've also tried changing the creationPolicy on the viewstack (and all
the viewstack children) to all, which didn't make any difference.

I've run through the debugger also and everything appears to be fine.

I'm really stuck and I'm ready to throw my computer out of the window.

Any ideas are greatly appreciated.

Reply via email to