DocWatson
09-15-2009, 07:24 PM
I've got a custom component (ApdRow) that overrides the default enabled getters and setters.
[Bindable]
override public function get enabled():Boolean
{
if (this.currentState == "Disabled")
{
return false;
}
return true;
}
override public function set enabled(value:Boolean):void
{
if (value)
{
this.setCurrentState('');
}
else
{
this.setCurrentState("Disabled");
}
}
As you can it SHOULD only set the state to the correct one (default or "Disabled"), and it seems to work perfectly, at least on named instances:
<ns1:ApdRow id="testApd" type="{ApdRowTypes.NUMERIC_STEPPER}" x="10" y="591">
</ns1:ApdRow>
<mx:Button x="10" y="561" label="Disable" click="testApd.enabled = false;"/>
<mx:Button x="86" y="561" label="Enable" click="testApd.enabled = true;"/>
But when I use it on an array that has ApdRows in it (e.g. rowArray[i].enabled = false;), it seems as though the child components in the row take on actual enabled values rather than following the states. Is this an issue with the named instances versus references?
[Bindable]
override public function get enabled():Boolean
{
if (this.currentState == "Disabled")
{
return false;
}
return true;
}
override public function set enabled(value:Boolean):void
{
if (value)
{
this.setCurrentState('');
}
else
{
this.setCurrentState("Disabled");
}
}
As you can it SHOULD only set the state to the correct one (default or "Disabled"), and it seems to work perfectly, at least on named instances:
<ns1:ApdRow id="testApd" type="{ApdRowTypes.NUMERIC_STEPPER}" x="10" y="591">
</ns1:ApdRow>
<mx:Button x="10" y="561" label="Disable" click="testApd.enabled = false;"/>
<mx:Button x="86" y="561" label="Enable" click="testApd.enabled = true;"/>
But when I use it on an array that has ApdRows in it (e.g. rowArray[i].enabled = false;), it seems as though the child components in the row take on actual enabled values rather than following the states. Is this an issue with the named instances versus references?