views:

200

answers:

1

Hello Everyone,

I want to create a notification icon like the the red one in the bottom right-hand corner of Facebook. I tried using a ToolTipManager to create a tooltip but since Tooltips appear in their own layer in Flex and, as far as I am able to figure, cannot be anchored to any part of the page. When the user uses the browser's scrollbar, they move.

Thank you in advance for any assistance,

Orville

A: 

If you want to use a manager, you should use the PopUpManager for this, but my own opinion is that would probably be overkill.

If you're using MXML, you could try adding the notification element to your page, positioned the way you want. Once you're happy with that, set its visible attribute to false. Then add event listeners to the appropriate events to change the value of the element's visible property.

If you're using ActionScript, I would create a 'Notification' class to define the appearance and any functionality of the notification element. I might subclass Canvas to do this, though subclassing Sprite may give you all the functionality you would need. Once you have a Notification object, you can add event listeners to the appropriate events to create/position the notification element or destroy it.

Ross Henderson
By definition, most things in Flex are "overkill", but PopUpManager is the standard way to accomplish this. This is what the combobox/datefield,etc... use to get their popups working, albeit differently for each control.
Glenn