Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : flex

flex BindableʹÓý²½â

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
 <mx:Panel width="392" height="300" layout="absolute">
  <mx:Label x="19" y="10" text="{user}" width="171" height="20"/>
  <mx:Button x="216" y="8" label="²âÊÔBindable" click="bind()" width="105"/>
  <mx:DataGrid x="19" y="58" dataProvider="{arr}">
   <mx:columns>
    <mx:DataGridColumn headerText="year" dataField="year"/>
    <mx:DataGridColumn headerText="city" dataField="city"/>
    <mx:DataGridColumn headerText="provice" dataField="provice"/>
    <mx:DataGridColumn headerText="total" dataField="total"/>
   </mx:columns>
  </mx:DataGrid>
 </mx:Panel>
 
 <mx:Script>
  <![CDATA[
  ......

flex TextInputµÄrestrictÓ¦ÓÃ

·¢ÏÖÁËÒ»¸öFlexÖÐTextInputµÄÒ»¸ö±È½ÏÓÐÓõÄÊôÐÔrestrict(Ô¼Êø,ÏÞ¶¨),ÏÈ¿´ÏÂÀý×Ó:
1,<mx:TextInput id="test_ti" width="160" maxChars="20" restrict="0-9" text="0"/>
ÕâÑù,Õâ¸öÊäÈë¿ò×î¶àÖ»ÄÜÊäÈë20¸ö×Ö·û,Ö»ÄÜÊäÈë0µ½9Ö®¼äµÄÊý×ÖÁË,ÄãÈç¹ûÊäÈë±ðµÄÊÇÊäÈë²»½øÈ¥µÄ
2,<mx:TextInput id="test_ti" width="160" maxChars="20" restrict="0-9\." text="0"/>
ÕâÑù,ÊäÈë¿ò¿ÉÒÔÊäÈë0µ½9Ö®¼äµÄÊý×Ö,ÒÔ¼°ÊäÈë'.',Öмä±ØÐëÓÃ'\'·Ö¸ô¿ªÀ´
3,<mx:TextInput id="test_ti" width="160"  restrict="0-9\ab" text="0"/>ÕâÑù,ÊäÈë¿ò¿ÉÒÔÊäÈë0µ½9Ö®¼äµÄÊý×Ö,ÒÔ¼°a,»òb
4,,<mx:TextInput id="test_ti" width="160"  restrict="a-z" text="0"/>
¿ÉÒÔÊäÈëaµ½zÖ®¼äÈκÎÒ»¸öÓ¢ÎÄ×Öĸ,'-'±íʾÇø¼ä,Èç¹ûÒªÊäÈë'-',¾Í±ØÐë¼Ó'\',Èç\-
/*ÏÂÃæÊÇ×Ô¼º¼ÓµÄ*/
5,<mx:TextInput restrict="a-z0-9"/>
¿ÉÒÔÊäÈëaµ½zºÍ0-9ÈÎÒâ×Öĸ»òÊý×Ö
6,<mx:TextInput restrict="A-Z"/>
¿ÉÒÔÊäÈëA-ZÈÎÒâ×Ö·û£¬ÎÞÂÛÄãÊäÈë·¨ÊÇ´óСд¶¼ÊÇ´óд×Öĸ
7,<mx:TextInput restrict=""/>
ÈκÎ×Ö·û¶¼²»ÔÊÐíÊäÈë
½áÂÛ:
ÓÃrestrictÓиöºÃ´¦,¾ÍÊÇÊ¡È¥ÁËÑéÖ¤µ ......

flex xml±éÀú

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:XML id="xmlSource">
    <node label="grandFather" state="unchecked">
        <node label="Father" state="unchecked">
            <node label="son" state="unchecked">
                <node label="1001" state="unchecked">
                    <node label="100101" state="unchecked">
                    </node>
                </node>
            </node>
        </node>
        <node label="Uncle3" state="unchecked">
            ......

flex xml±éÀú

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
<mx:XML id="xmlSource">
    <node label="grandFather" state="unchecked">
        <node label="Father" state="unchecked">
            <node label="son" state="unchecked">
                <node label="1001" state="unchecked">
                    <node label="100101" state="unchecked">
                    </node>
                </node>
            </node>
        </node>
        <node label="Uncle3" state="unchecked">
            ......

Flex£ºÓÃopenItemsÊôÐÔ½øÐÐTree¿Ø¼þµÄÕ¹¿ªÓë¹Ø±Õ

<?xml version="1.0" encoding="utf-8"?>
<!-- http://yecon.blog.hexun.com/28902341_d.html -->
<!-- http://www.slsay.com -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white">
    <mx:Script>
        <![CDATA[
            private function openAllNodes():void {
                tree.openItems = dp..node;
            }
            private function closeAllNodes():void {
                tree ......

flex DataGrid±à¼­µ¥Ôª¸ñ²¢»ñȡеÄÖµ

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal">
<mx:Panel width="458" height="313" layout="absolute">
<mx:Label id="lbl" x="19" y="10" text="" width="171" height="20"/>
<mx:DataGrid id="dg" x="19" y="58" dataProvider="{arr}" editable="true" itemEditEnd="editHandle(event)"
horizontalGridLines="true" horizontalGridLineColor="#B9F2C9" verticalGridLineColor="#B9F2C9">
<mx:columns>
<mx:DataGridColumn headerText="year" dataField="year" editable="false"/>
<mx:DataGridColumn headerText="city" dataField="city" editable="false"/>
<mx:DataGridColumn headerText="provice" dataField="provice" editable="false" sortable="false"/>
<mx:DataGridColumn headerText="total" dataField="total"/>
</mx:columns>
</mx:DataGrid>
</mx:Panel>
<mx:Script>
<!--[CDATA[
import mx.controls.dataGridClasses.DataGridColumn;
import mx.events.DataGridEvent;
......

FlexºÍJava½»»¥µÄÂÒÂë½â¾ö·½°¸


½ñÌì×öFlexʱÅöµ½flexºÍjava½»»¥µÄÂÒÂëÎÊÌ⣬ʹÓÃHTTPServiceÎÞÂÛÊÇ´ÓFlex¶Ë´«µ½Java¶Ë£¬»¹ÊÇ·´¹ýÀ´¶¼ÂÒÂë¡£µ÷²éÁË°ëÌ죬ÖÕÓڸ㶨ÁË¡£
 
 
ÒÔÏÂÊǽâ¾ö·½°¸£º
 
 
1.Flex¶Ë´«µ½Java¶Ë
 
Flex¶Ë:encodeURIComponent(comment.text)
ʹÓÃencodeURIComponent°Ñ²ÎÊýת»»Îª application/x-www-form-urlencoded ¸ñʽ
 
Java¶Ë:URLDecoder.decode(comment, "utf-8")
¶Ô x-www-form-urlencoded ×Ö·û´®½âÂë
 
2.Java¶Ë´«µ½Flex¶Ë
 
 
 
 
 
HttpServletResponse response = ServletActionContext.getResponse();
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=utf-8");

out.println(doc.asXML());
out.flush();
out.close();



HttpServletResponse response = ServletActionContext.getResponse();
ServletOutputStream out = response.getOutputStream();
response.setContentType("text/html;charset=utf-8");

out.write(doc.asXML().getBytes("UTF-8"));
out.flush();
out ......

FlexºÍJava½»»¥µÄÂÒÂë½â¾ö·½°¸


½ñÌì×öFlexʱÅöµ½flexºÍjava½»»¥µÄÂÒÂëÎÊÌ⣬ʹÓÃHTTPServiceÎÞÂÛÊÇ´ÓFlex¶Ë´«µ½Java¶Ë£¬»¹ÊÇ·´¹ýÀ´¶¼ÂÒÂë¡£µ÷²éÁË°ëÌ죬ÖÕÓڸ㶨ÁË¡£
 
 
ÒÔÏÂÊǽâ¾ö·½°¸£º
 
 
1.Flex¶Ë´«µ½Java¶Ë
 
Flex¶Ë:encodeURIComponent(comment.text)
ʹÓÃencodeURIComponent°Ñ²ÎÊýת»»Îª application/x-www-form-urlencoded ¸ñʽ
 
Java¶Ë:URLDecoder.decode(comment, "utf-8")
¶Ô x-www-form-urlencoded ×Ö·û´®½âÂë
 
2.Java¶Ë´«µ½Flex¶Ë
 
 
 
 
 
HttpServletResponse response = ServletActionContext.getResponse();
PrintWriter out = response.getWriter();
response.setContentType("text/html;charset=utf-8");

out.println(doc.asXML());
out.flush();
out.close();



HttpServletResponse response = ServletActionContext.getResponse();
ServletOutputStream out = response.getOutputStream();
response.setContentType("text/html;charset=utf-8");

out.write(doc.asXML().getBytes("UTF-8"));
out.flush();
out ......
×ܼǼÊý:792; ×ÜÒ³Êý:132; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [118] [119] [120] [121] 122 [123] [124] [125] [126] [127]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ