Saturday 15 January 2011

actionscript 3 - How do I get the LinkButton in flex to underline on mouse over -


I'm new to using Flex. I have a link button and I need it when I move the mouse again I press. I think it can be done by setstyle () but I do not know the syntax and how it works. I was looking around but it found something useful related to this.

Any help is greatly appreciated.

The syntax is to use:

  buttonObject.setStyle ( " property value");  

A complete example:

  & lt; Fx: script & gt; & Lt ;! [CDATA [import mx.controls.Alert; Protected function linkbutton1_clickHandler (Event: MouseEvent): Zero {Alert.show ('LinkButton selected!'); } Safe Function linkbutton1_mouseOverHandler (Event: MouseEvent): Zero {btn.setStyle ("textDecoration", "Underline"); } Safe Function linkbutton1_mouseOutHandler (Event: MouseEvent): Zero {btn.setStyle ("textDecoration", "None"); }] & Gt; & Lt; / Fx: script & gt; & Lt; mx: Click LinkButton id = "btn" label = "linkbutton control" color = "# 0000FF" font Wight = "bold" rollOverColor = "#FFFFFF" mouseOver = "linkbutton1_mouse Ovrhandlr (event)" mouseOut = "linkbutton1_mouseOutHandler (event)" = "linkbutton1_clickHandler (event)" / & gt;  

See more


No comments:

Post a Comment