Thanks for that tip, Tim. Worked beautifully! My application, however, also have a number of Canvases in a TabNavigator. I am trying to modify your example to also allow me to underline one letter of the Canvas label property, so that the user can see what shortcut key will access each tab as easily as the buttons.
The problem is that the textField property does not exist, and I do not know how to work around this. Thanks for any help! --- In [email protected], "Tim Hoff" <timh...@...> wrote: > > > Cool. > > -TH > > --- In [email protected], "Sefi Ninio" <sefi.ninio@> wrote: > > > > Hmm... I swear I tried it before, did the same thing and it didn't > work... > > Donno what I did differently... > > > > Heck, it works now :) > > > > Thanks man! > > > > On Fri, Nov 28, 2008 at 11:58 PM, Tim Hoff TimHoff@ wrote: > > > > > > > > Works for me. Create a simple test application and copy in > application > > > and component code that I posted. It probably doesn't matter, but > are > > > you using Flex3? > > > > > > > > > -TH > > > > > > --- In [email protected] <flexcoders%40yahoogroups.com>, > "Sefi > > > Ninio" sefi.ninio@ wrote: > > > > > > > > Hi Tim, > > > > > > > > Thanks for your reply. > > > > Unfortunately, it doesn't work... :( > > > > The button displays <u>O</u>pen... in plain text... > > > > > > > > On Thu, Nov 27, 2008 at 8:48 PM, Tim Hoff TimHoff@ wrote: > > > > > > > > > One caveat: since Button will measure the additional html > > > characters, > > > > > you might want to set the button's width explicitly. > > > > > > > > > > -TH > > > > > > > > > > > > > > > --- In [email protected] > <flexcoders%40yahoogroups.com>, "Tim > > > Hoff" TimHoff@ wrote: > > > > > > > > > > > > > > > > > > Hi Sefi, > > > > > > > > > > > > Here's a way that you can do that by extending Button: > > > > > > > > > > > > // AS > > > ---------------------------------------------------------- > > > > > > > > > > > > package controls > > > > > > { > > > > > > import mx.controls.Button; > > > > > > > > > > > > > > > > > > > > > > > > public class HTMLButton extends Button > > > > > > { > > > > > > public function HTMLButton() > > > > > > { > > > > > > super(); > > > > > > } > > > > > > > > > > > > override protected function > > > > > > > updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void > > > > > > { > > > > > > super.updateDisplayList(unscaledWidth, unscaledHeight); > > > > > > > > > > > > textField.htmlText = label; > > > > > > } > > > > > > } > > > > > > } > > > > > > > > > > > > // MXML > > > > > > > > > ---------------------------------------------------------- > > > > > > > > > > > > <?xml version="1.0" encoding="utf-8"?> > > > > > > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > > > > > > xmlns:controls="controls.*" > > > > > > creationComplete="onCreationComplete()"> > > > > > > > > > > > > > > > > > > > > > > > > <mx:Script> > > > > > > <![CDATA[ > > > > > > private function onCreationComplete():void > > > > > > { > > > > > > var myButtonHTMLText:String = "<u>O</u>pen"; > > > > > > myButton.label = myButtonHTMLText; > > > > > > } > > > > > > ]]> > > > > > > </mx:Script> > > > > > > > > > > > > > > > > > > > > > > > > <controls:HTMLButton id="myButton"/> > > > > > > > > > > > > > > > > > > > > > > > > </mx:Application> > > > > > > > > > > > > // ---------------------------------------------------------- > > > > > > > > > > > > -TH > > > > > > > > > > > > --- In [email protected] > <flexcoders%40yahoogroups.com>, > > > "Sefi Ninio" sefi.ninio@ wrote: > > > > > > > > > > > > > > Hey, > > > > > > > > > > > > > > I have set up a keyboard shortcut to call the onButtonClick > > > handler. > > > > > > > Now, I'd like the button label to hint that the shortcut is > > > present. > > > > > > > > > > > > > > For example, say the button label is 'Open' and the keyboard > > > shortcut > > > > > > is > > > > > > > Ctrl-O, I'd like the button label to be *O*pen, with > underline > > > only > > > > > > under > > > > > > > the O. > > > > > > > > > > > > > > I've searched the API as well as google to no avail. > > > > > > > I'm thinking of extending Button to enable this, but it > probably > > > won't > > > > > > be > > > > > > > trivial and I'd like to know if there's a simpler option > before > > > going > > > > > > that > > > > > > > path... > > > > > > > > > > > > > > Thanks, > > > > > > > Sefi > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >

