zoukankan      html  css  js  c++  java
  • Flex锁定页面遮罩【原创】

    主要实现功能是锁定父页面,然后给出友好提示

    效果图如下:

    Mxml
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout
    ="absolute"
    verticalScrollPolicy
    ="off"
    horizontalScrollPolicy
    ="off"
    xmlns:Masks
    ="Masks.*">

    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    private
    function myClickFunction():void
    {
    new MyMasks(canvasTest);
    }
    ]]
    >
    </mx:Script>

    <mx:Button x="150"
    y
    ="10"
    label
    ="Button"
    click
    ="myClickFunction();"/>

    <mx:Canvas id="canvasTest"
    backgroundColor
    ="#110E0E"
    x
    ="215"
    y
    ="132"
    width
    ="214"
    height
    ="137">
    <mx:Button x="74"
    y
    ="53"
    label
    ="Button"
    click
    ="Alert.show('test');"/>
    </mx:Canvas>
    </mx:Application>

    MyMasks
    package Masks
    {
    import flash.display.DisplayObject;

    import mx.containers.Canvas;
    import mx.containers.HBox;
    import mx.controls.SWFLoader;
    import mx.controls.Text;

    public class MyMasks extends Canvas
    {
    public
    function MyMasks(obj:DisplayObject)
    {
    super();

    var canvas:Canvas=obj as Canvas;
    var arr:Array = canvas.getChildren();

    for(var i:int=0;i<arr.length;i++)
    {
    if(arr[i] is MyMasks)
    {
    arr[i].visible
    = !arr[i].visible;
    return;
    }
    }

    this.setStyle("backgroundColor", "#FFFFFF");
    this.setStyle("backgroundAlpha", 0);
    this.width=canvas.width;
    this.height=canvas.height;

    var hbox:HBox=new HBox();
    hbox.setStyle(
    "width", "100%");

    var swfLoader:SWFLoader=new SWFLoader();
    swfLoader.source
    ="../assets/loader.swf";
    swfLoader.autoLoad
    =true;

    var text:Text=new Text();
    text.setStyle(
    "color", "#ffffff");
    text.text
    ="正在加载...";

    hbox.addChild(swfLoader);
    hbox.addChild(text);
    this.addChild(hbox);
    this.id="mask";
    canvas.addChild(
    this);
    }
    }
    }

  • 相关阅读:
    使用正向proxy 连调部署在k8s 中的spring cloud 中的rest服务
    goflow golang 的基于flow的编程库
    gvm golang 的多版本工具
    jvm-profiler 学习试用
    httpdiff http 请求diff 工具
    tengine lua 模块docker 镜像集成
    tengine 支持dubbo 的docker镜像
    openresty ngx.location.capture http2 问题
    systemd 使用rc.local 说明
    revel golang的全栈开发框架
  • 原文地址:https://www.cnblogs.com/myssh/p/1846673.html
Copyright © 2011-2022 走看看