zoukankan      html  css  js  c++  java
  • flashplayer9的全屏模式

    制作全屏效果有几点注意事项:
    1,全屏下 Flash 文本框无法输入.
    2,AS2 中一句话来调用全屏:
    Stage["displayState"] = "fullScreen";
    但必须使用事件处理器来调用才生效.就是:onPress,onClick...之类的.
    3,最后就是HTML中必须加入 <param name="allowFullScreen" value="true" />这段话.

    //例子

    有用的Flash AS脚本(设置全屏与右键菜单)

    // Action script...

    // [Action in Frame 1]
    function fuscreen()
    {
    Stage.displayState = "fullScreen";
    } // 设置全屏
    function exscreen()
    {
    Stage.displayState = "normal";
    } // 退出全屏
    function noscale()
    {
    Stage.scaleMode = "noScale";
    } // 无缩放(显示源Flash尺寸)
    function fullmode()
    {
    Stage.scaleMode = "showAll";
    } // 显示全部(根据屏幕来适应大小)

    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;
    }
    } // 设置右键菜单属性的函数(有热区与无热区)

    demo.loadMovie("demo.swf");
    Stage.scaleMode = "noScale";
    fscommand("fullscreen", "true");
    fscommand("allowscale", "false");
    back_mc.onRelease = function ()
    {
    fuscreen();
    };

    var fullscreen = new ContextMenu(menuHandler);
    fullscreen.hideBuiltInItems();

    var fs = new ContextMenuItem("开启全屏", fuscreen);
    fullscreen.customItems.push(fs);

    var xfs = new ContextMenuItem("退出全屏", exscreen);
    fullscreen.customItems.push(xfs);

    var ns = new ContextMenuItem("无缩放", noscale);
    ns.separatorBefore = true;
    fullscreen.customItems.push(ns);
    var sa = new ContextMenuItem("全部显示", fullmode);
    fullscreen.customItems.push(sa);
    this.menu = fullscreen;

  • 相关阅读:
    UVA 11859
    [OpenGL]OpenGL坐标系和坐标变换
    树状数组
    编程算法
    乞讨 间隔[a,b]在见面p^k*q*^m(k&gt;m)中数号码
    解析Android的 消息传递机制Handler
    Atitit.故障排除系列---php 计划网站数据库错误排除过程
    Remove Element
    [Angular Directive] Write a Structural Directive in Angular 2
    [Compose] 18. Maintaining structure whilst asyncing
  • 原文地址:https://www.cnblogs.com/zhangsir/p/1072701.html
Copyright © 2011-2022 走看看