Tuesday, June 01, 2010

Applying style to Tooltip in Flex 4

Applying style to Tooltips in Flex is more simpler than in Flex 3.

In Flex4 Style tag is used to define styles for the application,Style tag is component of is the sample style class to styleing tooltip component

@namespace s "library://";
@namespace mx "library://";

mx|ToolTip {
backgroundAlpha: 1.0;
fontSize: 21;
backgroundColor: #456789;
color: white;
cornerRadius: 0.5;


We can also do the same using the Actionscript code,here is the sample code for that

private function init():void {
var cssDecl:CSSStyleDeclaration = StyleManager.getStyleDeclaration("mx.controls.ToolTip");
if (!cssDecl) {
cssDecl = new CSSStyleDeclaration("mx.controls.ToolTip");
cssDecl.setStyle("backgroundAlpha", 1.0);
cssDecl.setStyle("backgroundColor", "black");
cssDecl.setStyle("color", "white");
cssDecl.setStyle("cornerRadius", 0);
cssDecl.setStyle("fontSize", 24);

Bookmark and Share


Post a Comment

  © Blogger templates by updated with tips

Back to TOP