首页 > 编程知识 正文

flexe2.0学习笔记

时间:2023-05-05 15:47:22 阅读:190277 作者:1472

? xmlversion=' 1.0 '?

MX : application xmlns : MX=' http://www.adobe.com/2006/mxml ' height=' 600 ' width=' 600 '

MX:脚本

! [CDATA[

import MX.containers.title window;

import flash.events. *;

import mx.managers.PopUpManager;

import mx.controls.Button;

import MX.core.iflexdisplayobject;

//thevariableforthetitlewindowcontainer

publicvarmytitlewindow : title window=new title window (;

//methodtoinstantiateanddisplayatitlewindowcontainer。

//thisistheinitialbuttoncontrol ' sclickeventhandler。

publicfunctionopenwindow (event : mouse event ) : void {

//setthetitlewindowcontainerproperties。

myTitleWindow=newTitleWindow (

my title window.show close button=true;

my title window.title=' my window title ';

myTitleWindow.width=220;

myTitleWindow.height=150;

//callthemethodtoaddthebuttoncontroltothe

//TitleWindowcontainer。

populateWindow (;

//usethepopupmanagertodisplaythetitlewindowcontainer。

popup manager.add popup (my title window,this,true );

}

//themethodtocreateandaddthebuttonchildcontroltothe

//TitleWindowcontainer。

public functionpopulateWindow () : void {

varbtn1:Button=newButton (;

BTN1 .标签='close ';

btn1.addevent listener (mouse event.click,closeTitleWindow );

mytitlewindow.addchild(BTN1;

}

//themethodtoclosethetitlewindowcontainer。

publicfunctionclosetitlewindow (event : mouse event ) : void {

popup manager.remove popup (event.current target.parent;

privatefunctionremoveForm () :void{

popup manager.remove popup (help window;

}

来定义自定义外观

/MX:脚本

MX : button label=' open window ' click=' open window () event

/MX : APP

事先贴上代码。 其实是FLEX的帮助文档,但是在网上找也找不到如何显示简单的表单。 另外,我不知道该怎么使用FLEX的帮助。 啊.今天在kenshin的注意下发现了这个。 my title window.show close button=true; 这个属性是我自己添加的,实现了简单的表单上的关闭按钮,但是还不知道如何处理那个事件,下次再说吧。 做到这一点后转载于3360https://www.cn blogs.com/Forrest sun/articles/471167.html

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。