Context Menu is not working in flash player 10.1
I write a flex application. I added some custom menu items in context menu. when I compiled this code using flashplayer 10.0, it works fine and my added context menu items are shown when I Right-Click. But when I compile same code for flashPlayer 10.1, menu items that I added in context menu are not shown when I Right-Click. What should I do to resolve this issue? I am using sdk 3.5.
Any help or suggestion will be appreciated.
I am doing this;
private var cm:ContextMenu = new ContextMenu();
var versionMenu:Co开发者_高级运维ntextMenuItem = null;
var dateMenu:ContextMenuItem = null;
if(model.appVersion.length > 0)
{
versionMenu = new ContextMenuItem(model.appVersion);
}
if(model.releaseDate.length > 0)
{
dateMenu = new ContextMenuItem(model.releaseDate);
}
cm.hideBuiltInItems();
var cmArray:Array = new Array();
if(versionMenu != null)
cmArray.push(versionMenu);
if(dateMenu != null)
cmArray.push(dateMenu);
cm.customItems = cmArray;
Thanks.
there is no reason. It works fine for me in flashPlayer 10.1 . Also it is listed as supported in 10.1 here : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/ui/ContextMenu.html
alert the isSupported property in code to double check (it will most definitely be true).
If you are trying to create a context menu for Application
then here is the correct code:
<s:Application ... initialize="init();">
private function init():void
{
var versionItem:ContextMenuItem = new ContextMenuItem("Version 1.5.443");
contextMenu.hideBuiltInItems();
contextMenu.customItems = [ versionItem ];
}
</s:Application>
精彩评论