A Tip on Date Class in Flex.

March 26, 2009

When you come across a Class and explore it, you should be really concentrating on the very basics of that Class first.So here I am talking about the Date Class.You can create Date Objects in four different ways.So explore about that, then you should be able to answer this question How to find the number of days betweeen two Date’s in Flex ?

Solution:

private const MS_PER_DAY:uint = 1000 * 60 * 60 * 24;

var strd1:Date=new Date(2009,2,18);
var strd2:Date=new Date(2009,2+1,18);
var tempDate:Date = new Date(strd2.time – strd1.time);

trace(‘No. of Days:’+tempDate.time/MS_PER_DAY);

Enjoy the post.


Custom BusyCursor Demo in Flex.

March 22, 2009

As some readers requested a demo on this post, so I am giving it here.Enjoy the post.

Run Demo

Comment me for query.


Display ToolTips for Combobox List items in Flex.

March 4, 2009

Note:Hello Readers, This post has some Bugs,so i will solve them ASAP and will make an update.My apologies for a buggy post.Meanwhile if anyone of you find a trick or tip please share them on the post.I appreciate for your feedback.Having said that, i am not disabling the code and demo, you can still access them and contribute.Thanks.

One of the readers asked this question, Is it possible to show ToolTips for the Combobox List items [on mouse over on each item i would like to show a ToolTip]?, and my answer was “YES”.And this post tells about that.

The First thing we got to remember here is the ToolTipManager Class and its methods.Basic information on how to create tooltips using this Class.

The ToolTipManager has two methods that let you programmatically use ToolTips. These methods are createToolTip() and destroyToolTip(), which you use to create and destroy new ToolTip objects. When you create a ToolTip object, you can customize it as you would any object, with access to its properties, styles, events, and effects.

[So explore more about this ToolTipManager Class to learn more], now we know how to create ToolTips using this Class, but how to show on the Combobox List items ?.Its simple using the ListEvent Class and on ListEvent.ITEM_ROLL_OVER raise an Event and write your code on the eventhandler to create tooltip.Check on the below code sample for this.And destroy the created tooltip on ListEvent.ITEM_ROLL_OUT.Isn’t that simple.

Run demo.

1.Download source code. –>This is with the itemRollOver,itemRollOut properties.

2.Download source code. –>This is with the addEventListener().

Enjoy the post.


Drag and Drop: From List Control to TextInput(Non-List) Control in Flex.

March 2, 2009

The list based controls in Flex has the built in support for the drag and drop.So to support the drag and drop operations for the non-list based components(here TextInput) we must handle the drag and drop events.
Go through the classes involded in the drag and drop operations,drag and drop events for a drag initiator,drag and drop events for a drop target to explicitly handle the drag and drop and to fully understand the drag and drop operations functionality.

For now enjoy the below demo and code.

 Run demo.

Download source code.


Follow

Get every new post delivered to your Inbox.