Code snippet:
var statusBarItem:ContextMenuItem = new ContextMenuItem("show me",
false, true, true);
showMeItem.addEventListener( ContextMenuEvent.MENU_ITEM_SELECT,
showMeListener );
cm.customItems.push(showMeItem);
Context menu doesn't change the label if it reset the caption
property. it shows me the label what i have set ate the begining only.
can some body help!!!
public function showMeListener(event:ContextMenuEvent):void {
var statusBarItem:ContextMenuItem = ContextMenuItem(event.currentTarget);
var statusCaption:String = "";
if(ModelLocator.getInstance().xyzModel.showMe == true) {
ModelLocator.getInstance().visualizerModel.showME = false;
statusCaption = "Hide me";
} else {
ModelLocator.getInstance().visualizerModel.showME = true;
statusCaption = "Show me";
}
statusBarItem.caption = statusCaption;
}
but my context menu caption is not changing from "Show me" to "Hide
me" and vice versa.