zoukankan      html  css  js  c++  java
  • Alert组件

    在库中添加一个Alert组件和一个Button组件,以下代码放在flash文件的第一帧:
    import mx.controls.Alert; 
    import mx.controls.Button; 
    this.createClassObject(mx.controls.Button, "my_btn"1{label:"Play"}); 
    my_btn.setSize(
    10025); 
    my_btn.move(
    180170); 
    var myListener:Object = new Object(); 
    myListener.click 
    = function() 
      
    var myObj:Object = new Object(); 
      myObj.click 
    = function(evt_obj:Object) 
        
    if (evt_obj.detail == Alert.OK) 
          
    var my_fmt:TextFormat = new TextFormat(); 
          my_fmt.font 
    = "Arial"
          my_fmt.size 
    = 20
          my_fmt.color 
    = 0xFF0000
          _root.createTextField(
    "my_txt"10808020040); 
          my_txt.setNewTextFormat(my_fmt); 
          my_txt.text 
    = "你开心,我快乐!"
        }
     else 
          _root.createTextField(
    "my_txt"1010010020020); 
          my_txt.text 
    = "让我分担你的忧愁好吗?"
        }
     
      }

      Alert.buttonWidth 
    = 100
      Alert.okLabel 
    = "我笑了!:)"
      Alert.noLabel 
    = "今天我没有笑:("
      Alert.show(
    "今天你笑了吗?""请回答", Alert.OK | Alert.NO, null, myObj); 
    }

    my_btn.addEventListener(
    "click", myListener); 

  • 相关阅读:
    [codevs2800]送外卖
    python JSON处理
    python系统编码格式
    python,django,mysql版本号查询
    django开发总结:
    python之---类和实例
    django Q和F查询
    合并多个python list以及合并多个 django QuerySet 的方法
    python学习之---匿名函数,返回函数,偏函数
    python学习之---生成器
  • 原文地址:https://www.cnblogs.com/shengshuai/p/Flash_alert.html
Copyright © 2011-2022 走看看