Using the ToolTip Manager Class.

August 31, 2008

The ToolTipManager class lets you set basic ToolTip functionality.The ToolTipManager class also contains a reference to the current ToolTip in its currentToolTip property. The Functionality like first one enable and disable the tooltips.

The Code for enabling and disabling the tooltips for the Application is.

ToolTipManager.enabled = true;   –> for enableing.

ToolTipManager.enabled = false;   –> for disabling.

Click here to view the example. Tune on to see more examples on ToolTip Manager Class.


Free Flex Builder licenses For EveryOne who Attends their upcoming Flex developer event.

August 28, 2008

Its a surprise but its true , Adobe Announced that will give out free Flex Builder licenses to everyone who attends their upcoming Flex developer event. If you tried to purchase it and failed then here is an opportunity for everyone who wants it, and its FREE FREE FREE.

For updates regarding this event visit the Link below and enter your details. It will update you.

Register For Details/Updates

A special thanks to the Adobe Evangelism team in India.

Enjoy the Post. :-)


Changing the Button Icon Dynamically.Using the setStyle() method.

August 27, 2008

Dynamically to change the icon of a Button, you can use the following code and its simple and small.

For Example in MXML There’s a Button:

<Button id=”btn” icon=”@Embed(images/icon1.png)” />

Then to change the Icon for the Above Button in AS use the Following code in Script Tag:

[Embed(source="images/icon2.png")]

[Bindable]
public var iconSymbol:Class;

btn.setStyle(“icon”,iconSymbol);    —>This will change the icon.

This change can be made on an Event like click on another Button.

Click here to view the Example of it.

Think Dynamically, :-) Enjoy the Post.Comments are welcome.

Updated:

Download code here


Design your own ToolTipBorder in Flex[Custom ToolTipBorder in Flex].With Example !

August 19, 2008

The first question is “From where does the ToolTip gets his Border ?“, well the answer to this question is from the ToolTipBorder Class.And this Class draws the border to the ToolTip., this class is from the Package mx.skins.halo and ToolTipBorder.as is the ActionScript Class.

Now lets see how can we change this Default Border of the ToolTip.[changes to this .as Class].Open the .as class from the sdk’s in the FlexBuilder installation folder as given per the package[look in to the package's]

Now if you can see the Class File[.as] ,the updateDisplayList() is the method which draws the ToolTipBorder and in this method there’s a switch() statement and in this the “tooltip” case is the code which draws the ToolTipBorder.

And this is the code with the case statement inside the switch() statement.

case “toolTip”:

{

// face

drawRoundRect(

3, 1, w – 6, h – 4, cornerRadius,

backgroundColor, backgroundAlpha)

if (!dropShadow)

dropShadow = new RectangularDropShadow();

dropShadow.distance = 3;

dropShadow.angle = 90;

dropShadow.color = 0;

dropShadow.alpha = 0.4;

dropShadow.tlRadius = cornerRadius + 2;

dropShadow.trRadius = cornerRadius + 2;

dropShadow.blRadius = cornerRadius + 2;

dropShadow.brRadius = cornerRadius + 2;

dropShadow.drawShadow(graphics, 3, 0, w – 6, h – 4);

break;

}

Now if you want a different Border to the ToolTip change should be made to this and inside this case statement only.

For Example, I will include the following lines of code in to the “tooltip” case

// New border

var highlightAlphas:Array = [0.3,0.0];

drawRoundRect(

11, 0, w – 11, h – 2, 3,

[0xFF0000, 0xFFFFBB], backgroundAlpha);

// left pointer

g.beginFill(borderColor, backgroundAlpha);

g.moveTo(11, 7);

g.lineTo(0, 13);

g.lineTo(11, 19);

g.moveTo(11, 7);

g.endFill();

filters = [ new DropShadowFilter(2, 90, 0, 0.4) ];

break;

And save the Class file[ToolTipBorder.as] as NewToolTipBorder.as in to your projects.Then to include the New Class file[NewToolTipBorder] to the Application you got to do the following code.

<mx:Style>

ToolTip

{

borderSkin: ClassReference(“NewToolTipBorder”);

}

</mx:Style>

Now if you define the tooltip property to any visible component and run the Application you can observe the Change to the ToolTipBorder.A change to the Default border of the ToolTip is made , similarly and accordingly you can make changes to the code[case statement lines] and define your own ToolTipBorder to the ToolTip.

So Finally we made this. Click Here to view the sample Application.

This post touches the core concepts of Classes.Enjoy the post. :-) .Queries are welcome.


import and Embed fonts in to your App.

August 11, 2008

The following code can be used in the stylesheet to import the font into your App.

@font-face {
src:url(“fonts/lucidaGrande.swf”);
fontFamily: “Lucida Grande”;
}

Now you can use this font in the App, like.

Panel{

fontSize: 12;
fontFamily: “Handwriting – Dakota”;
fontWeight:bold;
}

Enjoy the post..


View Example for “Code Example on “Setting dynamically rowCount property on DataGrid.””

August 6, 2008

The actual post is here

Example can be seen here

Enjoy the post.Comments are welcome. ;-)