建站学 - 轻松建站从此开始!

建站学-个人建站指南,网页制作,网站设计,网站制作教程

当前位置: 建站学 > 图像设计 > Flash教程 >

没有名为'displayState'的属性

时间:2012-04-08 14:21来源: 作者: 点击:
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
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;
(责任编辑:admin)
织梦二维码生成器
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:点击我更换图片