Store references to each in an Array, then loop over the array.

 

Tracy Spratt 
Lariat Services 

Flex development bandwidth available 

________________________________

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of sailorsea21
Sent: Friday, February 13, 2009 4:01 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] DYNAMIC LINKBUTTONS styleNames.

 

I have a series of 3 linkButtons.
I am able to switch the styleName of a linkButton when I click on it 
as follows:

[Bindable]
private var linkButton:String = 'linkButton';

[Bindable]
private var linkButtonOff:String = 'linkButtonOff';

<mx:LinkButton id="test001" label="001" styleName="{linkButton}" 
buttonMode="true" click="setType(event)"/>

<mx:LinkButton id="test002" label="002" styleName="{linkButton}" 
buttonMode="true" click="setType(event)"/>

<mx:LinkButton id="test003" label="003" styleName="{linkButton}" 
buttonMode="true" click="setType(event)"/>

private function setType(result:Event):void
{
result.currentTarget.styleName = linkButtonOff;
}

How can I automatically reset all the other linkButtons styleNames 
to "{linkButton}" when a linkButton is clicked?

Thank you.



Reply via email to