RE: [flexcoders] Re: ToggleButtonBar: Styling Individual Button
Kenny, You will need to cast the child to a Button. In the future, include the compiler error in your message. This will help the forum isolate your problem. HTH, Jason ?xml version=1.0 encoding=iso-8859-1 ? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml mx:Script public function changeStyle():void { Button(bb.getChildAt(0)).setStyle(borderColor,0x23FF33); } /mx:Script mx:ButtonBar id=bb dataProvider={['won', 'too', 'tree', 'for']}/ mx:Button click=changeStyle()/ /mx:Application From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of lostinrecursion Sent: Monday, August 28, 2006 9:11 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: ToggleButtonBar: Styling Individual Button Jason, How do you iterate through the ButtonBar? Meaning I notice the following code does not work and reports an error in Flex: myButtonBar.getChildAt(0).setStyle(backgroundColor, 0x99); Thank you. (I will also check out the documentation on this as well) -Kenny __._,_.___ -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com SPONSORED LINKS Software development tool Software development Software development services Home design software Software development company YAHOO! GROUPS LINKS Visit your group "flexcoders" on the web. To unsubscribe from this group, send an email to:[EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. __,_._,___
[flexcoders] Re: ToggleButtonBar: Styling Individual Button
Hey hey hey, I had just such a question, so I spent a bit of time looking into how to access the child buttons of a button bar, and skin them uniquely, as opposed to simply skinning the first - rest - and last. I figured out how to do it, and ran a cool looking custom skin over the top of it, but I don't have the screenshot, or code handy (I'm at work). I used an extended button bar to display the steps of a wizard process, with the current step of the wizard being visually referenced by the accompanying step name on the button bar. I had the entire skin customised - semi-3d looking square blocks of different colours with big numbers on each. I'll post the code for it tomorrow, as well as a screenshot of it working. It is possible, it's a little tricky as you have to access the the child a bit differently to how I expected. Here's a href=http://grae.halltech.com.au/media/uiruntimeskin.jpg an earlier example/a I was working on, where I overrode the skins of various uicomponents at runtime with programmatically drawn skins. img src=http://grae.halltech.com.au/media/uiruntimeskin.jpg / and, in case the list strips out the html, here's a text link to it. I'll post a useful, commented, and flexible example for you tomorrow night. Grae Hall Senior Designer www.daemon.com.au --- In flexcoders@yahoogroups.com, lostinrecursion [EMAIL PROTECTED] wrote: Hi all, I looked through the docs and did a couple of Googles but couldn't find anything on this. Is it possible to style each individual button in a ToggleButtonBar? For example, assigning a different background color to each one? Thanks -Kenny -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
[flexcoders] Re: ToggleButtonBar: Styling Individual Button
Jason, How do you iterate through the ButtonBar? Meaning I notice the following code does not work and reports an error in Flex: myButtonBar.getChildAt(0).setStyle(backgroundColor, 0x99); Thank you. (I will also check out the documentation on this as well) -Kenny -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/