How to create a list item as a tool tips for a combo box item?
Import mx.events.ListEvent; Import mx.managers.ToolTipManager; Import mx.controls.ToolTip;
public my mytip: ToolTip; Private function fnInit (): Zero {cmb.addEventListener (ListEvent.ITEM_ROLL_OVER, fnCreToolTip); Cmb.addEventListener (ListEvent.ITEM_ROLL_OUT, fnCreToolTip); Cmb.addEventListener (ListEvent.CHANGE, fnCreToolTip); } Private function fnCreToolTip (e: ListEvent): zero {switch (e.type) {case ListEvent.ITEM_ROLL_OVER: {// tooltip creates MyTip = ToolTipManager.createToolTip (array2 [e.rowIndex] .tooltip, stage.mouseX + 10 , Stage.mouseY) as tooltip; // array2 arraylist is brake id; } Case ListEvent.ITEM_ROLL_OUT: {// Delete the built-in tooltip, so that we can create a new one for others. ToolTipManager.destroyToolTip (myTip); break; } CaseEvent.CHANGE: {// destroy the blast tooltip, so that we can create a new one for others. ToolTipManager.destroyToolTip (myTip); break; }}}
No comments:
Post a Comment