I'm using a DateChooser, and want to show different information in a tooltip as the user rolls over each day. Is there an event that fires as I'm rolling around the calendar that will tell me what day I'm currently over?
3 Answers
It's a little complicated. You're going to need to use the mx_internal namespace. The grid portion of the DateChooser component is a CalenderLayout component in DateChooser.as.
mx_internal var dataGrid:CalenderLayout;
CalenderLayout.as has the mouseMoveHandler. In the handler we have:
var selCell:IUITextField = dayBlocksArray[colIndex][rowIndex];
that gives you the necessary info about which day the mouse is over. You will need to extend DateChooser to use an extended CalendarLayout that exposes the selectedCell.
perhaps:
private function mouseMoveHandler(event:MouseEvent):void
{
...
dispatchEvent(new DayHoverEvent(selCell.text));
}
I guess what I'm trying to say is it's kinda tricky, and it uses mx_internal, which means the variables are subject to change in later versions of Flex.

- 13,836
- 8
- 42
- 58
-
Sweet exactly what i was searching for. I added a dispatchEvent to mousup instead of MouseMoveHandler as MouseMoveHandler was triggering streaming events of selCell.text. – Satish Sep 26 '09 at 13:12
You may want to check out my blog post on this: http://flexmonkey.blogspot.com/2010/06/displaying-color-coded-events-in-flex.html
I've based this on some previous work by Kevin Brammer (http://www.cyberslingers.com/weblog/post/Adding-Calendar-Event-Entries-to-the-Flex-DateChooser-Component.aspx) - it allows you to add a tooltip to individual days and colour code them
Hope it helps,
simon

- 3,583
- 17
- 19
What about change
?

- 108,024
- 16
- 131
- 187
-
-
(or perhaps when the selected date is changed programmatically) -- I'm not talking about the selected date, only the hovered date. – sprugman Apr 02 '09 at 17:56
-
You will need to have a MouseEvent handler as suggested in the other post. – dirkgently Apr 03 '09 at 04:08