as3.0、as2.0与as1.0全屏代码

时间:12-04-03 栏目:网站开发 作者:admin 评论:0 点击: 97,029 次

AS2.0

function FullScreeeMode()
{
if (Stage["displayState"] == "normal") {
fscommand("fullscreen", true);
Stage["displayState"] = "fullScreen";
}else if (Stage["displayState"] == "fullScreen") {
fscommand("fullscreen", false);
Stage["displayState"] = "normal";
}
} // End of the function
fullScreenButton.onRelease = function ()
{
FullScreeeMode();
};
fullScreenButton.onRollOver = function ()
{
fullScreenButton.gotoAndPlay(2);
};
fullScreenButton.onRollOut = function ()
{
fullScreenButton.gotoAndStop(1);
};
AS1.0

function FullScreeeMode()
{
var _loc2 = getVersion();
var _loc1 = _loc2;
var _loc3 = _loc1.split(" ")[1].split(",")[0];
if (_loc3 >= 9)
{
if (Stage.displayState == "fullScreen")
{
Stage.displayState = "normal";
}
else
{
Stage.displayState = "fullScreen";
} // end else if
}
else
{
_level0.lobbyContainer.versionMsg_mc.gotoAndStop(2);
} // end else if
} // End of the function

fullScreenButton.onRelease = function ()
{
FullScreeeMode();
};
fullScreenButton.onRollOver = function ()
{
fullScreenButton.gotoAndPlay(2);
};
fullScreenButton.onRollOut = function ()
{
fullScreenButton.gotoAndStop(1);
};

AS3.0

 
function toggleFullScreen(event:MouseEvent):void
{
switch (stage.displayState)
{
case "normal" :
stage.displayState = "fullScreen";
break;
case "fullScreen" :
default :
stage.displayState = "normal";
break;

}
}

fullScreenButton.addEventListener(MouseEvent.MOUSE_UP,toggleFullScreen);
fullScreenButton.addEventListener(MouseEvent.MOUSE_OVER,function (){
fullScreenButton.gotoAndPlay(2);
});
fullScreenButton.addEventListener(MouseEvent.MOUSE_OUT,function (){
fullScreenButton.gotoAndStop(1);
});
 

声明: 本文由( admin )原创编译,转载请保留链接: as3.0、as2.0与as1.0全屏代码

as3.0、as2.0与as1.0全屏代码:等您坐沙发呢!

发表评论


------====== 本站公告 ======------
联系信息:
电话:19970108113(微信同号) QQ:3142401606
支付宝:https://me.alipay.com/lxq73061
相关插件程序等信息均会在站内发布,敬请关注。

读者排行