Hi Ryan, thanks :) I knew that... :) 
but the problem I'm having is that the values in my array are Strings. so the 
following gives me an error... 

The values are the IDs of the linkButtons that I would like to target.... 

[Bindable]privatevarbuttons:Array = newArray("test001", "test002", "test003");
{

I get the following error: Cannot create property styleName on String.
 
I understand the problem but I don't know how to set my array to object or IDs 
???
 
Thanks for your help!
 
-David



________________________________
From: Ryan Graham <ryan.gra...@phoenix.edu>
To: flexcoders@yahoogroups.com
Sent: Friday, February 13, 2009 5:08:17 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.


Hey now, you knew this was in the docs… :D
 
http://livedocs. adobe.com/ flex/3/html/ help.html? content=03_ Language_ 
and_Syntax_ 16.html
 
HTH,
Ryan
 
From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of - -
Sent: Friday, February 13, 2009 2:28 PM
To: flexcod...@yahoogro ups.com
Subject: Re: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
 
Hi Tracy, I created an array of all the IDs of my linkButtons, can you show me 
an example how to loop in the array?
 
Thanks.
 

________________________________

From:Tracy Spratt <tspr...@lariatinc. com>
To: flexcod...@yahoogro ups.com
Sent: Friday, February 13, 2009 4:11:05 PM
Subject: RE: [flexcoders] DYNAMIC LINKBUTTONS styleNames.
Store references to each in an Array, then loop over the array.
 
Tracy Spratt
Lariat Services
Flex development bandwidth available

________________________________

From:flexcod...@yahoogro ups.com [mailto:flexcoders@ yahoogroups. com] On 
Behalf Of sailorsea21
Sent: Friday, February 13, 2009 4:01 PM
To: flexcod...@yahoogro ups.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.currentTarge t.styleName = linkButtonOff;
}

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

Thank you.
 
This message is private and confidential. If you have received it in error, 
please notify the sender and remove it from your system.
 
foreach(varbutton inbuttons)    button.styleName = linkButton; }


      

Reply via email to