I have a custom class, WizardLeftTab that inherits from WizardTabBase >>
SkinnableContainer,. WizardTabBase has the following custom properties:
// ---------------------
private var _isSelected:Boolean;
[Bindable]
public function get isSelected():Boolean
{
return _isSelected;
}
public function set isSelected( val:Boolean ):void
{
_isSelected = val;
currentState = ( _isSelected ) ? 'selected' :
'normal';
invalidateSkinState();
}
...
override protected function getCurrentSkinState():String
{
if( !enabled )
{
currentState = 'disabled';
}
else if( isSelected )
{
currentState = 'selected';
}
return currentState;
}
In another class (NavigationModel) I have a function that calls set isSelected:
// ---------------------
public function setSelectedTab( tab:WizardLeftTab ):void
{
for each( var mtab:WizardLeftTab in tabsRegistry )
{
mtab.isSelected = false;
}
tab.isSelected = true;
}
(in this class, tabsRegistry is an ArrayCollection)
When I trace through the code, it does this:
>>in the for.. loop<<
it finds each mtab correctly,
it calls the set isSelected
WITHOUT going into the body, it jumps immediately to the get isSelected and
returns false, and so the skin state is never updated
>>in the tab.isSelected = true statement <<
then it behaves correctly, calling the setter and all the methods in the setter
body
Even more strangely, if I remove the [Bindable] tag, it again finds each mtab
correctly, passes into the body of the setter and calls all its methods, and
yet the getCurrentSkinState still returns 'selected' once it has been set
Im about at my wit's end. Any insight would be most appreciated.
Thanks