易截截图软件、单文件、免安装、纯绿色、仅160KB

Flex 学习笔迹之1 flex的事件(1)

Adobe Flex 3 Help > Flex Programming Elements > Using Events
Adobe Flex 3 Help
 
Flex Programming Elements / Using Events
Using events
Using events in Flex is a two-step process. First, you write a function or class method, known as an event listener or event handler, that responds to events. The function often accesses the properties of the Event object or some other settings of the application state. The signature of this function usually includes an argument that specifies the event type being passed in.
The following example shows a simple event listener function that reports when a control triggers the event that it is listening for:
<?xml version="1.0"?>
<!-- events/SimpleEventHandler.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp();">
<mx:Script><![CDATA[
import mx.controls.Alert;
private function initApp():void {
b1.addEventListener(MouseEvent.CLICK, myEventHandler);
}
private function myEventHandler(event:Event):void {
Alert.show("An event occurred.");
}
]]></mx:Script>
<mx:Button id="b1" label="Click Me"/>
</mx:Application>
As you can see in this example, you also register that function or class method with a display list object by using the addEventListener() method.
Most Flex controls simplify listener registration by letting you specify the listener inside the MXML tag. For example, instead of using the addEventListener() method to specify a listener function for the Button control's click event, you specify it in the click attribute of the <mx:Button> tag:
<?xml version="1.0"?>
<!-- events/SimplerEventHandler.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
import mx.controls.Alert;
private function myEventHandler(event:Event):void {
Alert.s


相关文档:

Flex 实现鼠标手势 无码 );

声明:自己想的、写的东西,转载请注明出处; 不要向我要代码; from CSDN ID: wander000
目的:在做小程序时,显示一些重要的数据如帐号密码等,不想让别人直接看到,在指定组件上按规定好的轨迹晃动鼠标才显示。
问题:一、直接打开数据库不就看到明码了?二、怎么判断鼠标轨迹的形状?
解决:一、数据库存取时用上加 ......

flex调用as2的swf

由于avm版本的问题,flex3无法直接调用flash做的swf文件,弄了一天,最后终于想到了一个办法,将LocalConnect和flex调用as3两种方式攒在了一起,算是暂时把这个问题解决了!
存起来,留着以后修改
第一步:用flash做一个as2的文件
我在里面添加了一个按钮
在第一帧写下面的代码
mybtn.onRelease=function()
 {
......

flex中父窗口与子窗口的通信

假设父窗口是p,子窗口是c,子窗口进行操作后返回父窗口
父窗口:
var flag:Boolean = false;
var c:pop = pop(PopUpManager.createPopUp(this,pop,false)); // 新建子窗体对象
c.callFunction = this.fresh; // 子窗体中可以调用的父窗体函数(这里是子窗体关闭时,用来刷新父窗体的内容
function fresh():void
  ......

[Flex] First Flex AIR App

试用了一下Flex,创建HelloWorld应用的顺序如下:
1 创建文件: HelloWorld-app.xml 
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://ns.adobe.com/air/application/1.5">
    <id>com.kdevn.flex.HelloWorld</id>
    <version&g ......

flex 小技巧

两个不同的flex自定义控件怎么相互控制?
比如当在一个只有add方法的控件框mxml里,当提交成功的时候,怎么更新另外一个有datagird控件框的mxml?
就可以用如下方法:在主应用程序里面,对子控件datagird进行操作;
1、parentApplication.refreshAdmin();       //在add子控件
2、public ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号