Flex学习笔记-使用MXML和一个AS事件监听器监听事件
2024-10-16 20:54:55
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<fx:Script>
<![CDATA[
import mx.controls.Alert;
protected function onClick(event:Event):void{
Alert.show(event.target.label+"clicked","Event Test");
}
]]>
</fx:Script>
<s:Button label="Button 1" click="onClick(event)"/> </s:Application>
a.mxml
内联MXML
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
<s:Button label="按钮1"> <s:click>
<![CDATA[
import mx.controls.Alert;
Alert.show(event.target.label + "clicked","Event Test");
]]>
</s:click>
</s:Button>
</s:Application>
最新文章
- Safari浏览器中对js Date对象的支持
- Java关键字——throws和throw
- MPlayer-ww 增加边看边剪切功能+生成高质量GIF功能
- LTE 切换过程中的数据切换
- 谈 IIS7.5 Asp.Net模拟用户
- easyUI 比较时间大小
- stack around the variable “XX” was corrupted
- oracle的常见问题与解决
- 修饰模式(Decorator结构化)C#简单的例子
- 安装supervisor
- 关于Windows系统不会变慢的设想
- LeetCode 13 Roman to Integer 解题报告
- bootstrap排列顺序
- Python 和 Scikit-Learn
- Mongoose基础
- Spark学习笔记——安装和WordCount
- HDU 1247 Hat’s Words(字典树)
- php扩展yaf 按照配置
- Kilani and the Game CodeForces - 1105D (bfs)
- hibernate学习之一 框架配置
热门文章
- VBScript Scripting Techniques: File Open Dialog http://www.robvanderwoude.com/vbstech_ui_fileopen.php
- C++进阶--编译器自动生成的类函数
- 修改最后一次 已commit 的备注
- 优化 要引入多个 模块 使用调用的方法,让管理更便捷 --execfile() 函数
- Js学习(1)
- OpenJudge Cartesian Tree
- IntelliJ IDEA 版本控制器 - Git
- navicat创建存储过程的小问题
- 微信小程序--swiper组件
- KVM总结-KVM性能优化之内存优化