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

flex的Canvas可以和HTML的DIV一样做块状的网格布局

用到的MX标签:constraintColumns、ConstraintColumn、constraintRows、ConstraintRow
给大家说说前提情况:在做MXML布局时,要嵌套很多层级,这里面有很多问题:
1、嵌套太多层级会影响效率!
2、嵌套太多层级,代码的可读性、可维护性差!
3、嵌套太多层级是因为Canvas、Vbox、Hbox功能单一,不能满足需要,而不是必须要这样做。
好吧,来看一个MXML代码示例:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="955" minHeight="600">

<mx:constraintColumns>
<mx:ConstraintColumn id="column1" width="250"/>
<mx:ConstraintColumn id="column2" width="100%"/>
</mx:constraintColumns>

<mx:constraintRows>
<mx:ConstraintRow id="row1" height="25"/>
<mx:ConstraintRow id="row2" height="25"/>
<mx:ConstraintRow id="row3" height="100%"/>
<mx:ConstraintRow id="row4" height="35"/>
</mx:constraintRows>
<mx:Button id="topMenuCvs" label="topMenuCvs" width="100%"
top="row1:0" bottom="row1:0"/>

<mx:Button id="topButtonCvs" label="topButtonCvs" width="100%"
top="row2:0" bottom="row2:0"/>

<mx:Button id="leftNavCvs" label="leftNavCvs" height="100%"
top="row3:0" bottom="row3:0" left="column1:0" right="column1:0"/>

<mx:Button id="leftMainCvs" label="leftMainCvs" height="100%"
top="row3:0" bottom="row3:0" left="column2:0" right="column2:0"/>

<mx:Button id="footCvs" label="footCvs" width="100%"
top="row4:0" bottom="row4:0"/>

</mx:Application>
 效果图:


相关文档:

flex中的属性


flex 控件属性
2009-11-12 16:06
使用<mx:Style>标签在MXML文件中创建本地的样式定义。这个标签包含了符合CSS2.0语法的样式表定
义。这些定义会应用到当前文档以及当前文档的子文档。
<mx:style>
.solidBorder{//类选择样式
borderStyle:solid;
}
button{//组件定义样式
borderStyle:solid;
}
.. ......

Flex 与 java 通讯 【转】

    2.2 代码实现
      下面给出了FlexBuilder工程的一个文件,设置了Flash的布局。
     view plaincopy to clipboardprint?
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
......

Flex 与 servlet 通信 【xml】

String userId = request.getParameter("userId");
System.out.println(userId);
response.setCharacterEncoding("UTF-8");
//response.getWriter().println("hello world -- 我爱你。。。");
String xml = "<user>" +
"<username>涛哥</username>" +
"</user>";
respon ......

jsForm Html Form via JSON with jQuery

/* 1 construct html form 2 bind data to form 3 validate form data 4 collect data from form */  (function($){     var controlTypes = ['textbox','password',' ......

去除网站中HTML标签的正则表达式

string str = a.ToString();
str = Regex.Replace(str, @"</?span[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"&#[^>]*;", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, @"</?marquee[^>]*>", "", RegexOptions.IgnoreCase);
str = Regex.Replace(str, ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号