触摸屏租赁
Touch screen rental
广告机租赁
Advertising rental
机器人租赁
Robot leasing
 当前位置:首页 > > flash发布没有名为'displayState'的属性解决方法

function goFullScreen()
{
Stage.displayState = "fullScreen";
} // End of the function
function exitFullScreen()
{
Stage.displayState = "normal";
} // End of the function
function menuHandler(obj, menuObj)
{
if (Stage.displayState == "normal")
{
menuObj.customItems[0].enabled = true;
menuObj.customItems[1].enabled = false;
}
else
{
menuObj.customItems[0].enabled = false;
menuObj.customItems[1].enabled = true;
} // end else if
} // End of the function
var fullscreenCM = new ContextMenu(menuHandler);
fullscreenCM.hideBuiltInItems();
var fs = new ContextMenuItem("Go Full Screen", goFullScreen);
fullscreenCM.customItems.push(fs);
var xfs = new ContextMenuItem("Exit Full Screen", exitFullScreen);
fullscreenCM.customItems.push(xfs);
_root.menu = fullscreenCM;

错误提示:没有名为'displayState'的属性

解决方法:

改为以下红字,将.displayState改为["displayState"]:

function goFullScreen()
{
Stage["displayState"] = "fullScreen";
} // End of the function
function exitFullScreen()
{
Stage["displayState"] = "normal";
} // End of the function
function menuHandler(obj, menuObj)
{
if (Stage["displayState"] == "normal")
{
menuObj.customItems[0].enabled = true;
menuObj.customItems[1].enabled = false;
}
else
{
menuObj.customItems[0].enabled = false;
menuObj.customItems[1].enabled = true;
} // end else if
} // End of the function
var fullscreenCM = new ContextMenu(menuHandler);
fullscreenCM.hideBuiltInItems();
var fs = new ContextMenuItem("Go Full Screen", goFullScreen);
fullscreenCM.customItems.push(fs);
var xfs = new ContextMenuItem("Exit Full Screen", exitFullScreen);
fullscreenCM.customItems.push(xfs);
_root.menu = fullscreenCM;


工作室地址:重庆石桥铺电脑城B座 | 微信:z35544216 | 网址:www.35544216.com