Flex Socket Óë¡¡£Ã#¡¡Í¨ÐÅ
Flex¶Ë´úÂ룺
<?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;
/////////////////////////////////
//private member
private var xmlsocket:XMLSocket= new XMLSocket();
private var alert:Alert;
private var tmpStr:String;
/////////////////////////////////
//Á¬½Ó·þÎñÆ÷
private function ConncetServer():void
{
xmlsocket.addEventListener(DataEvent.DATA,OnRecived);
xmlsocket.addEventListener(Event.CONNECT , onConnected);
this.xmlsocket.connect(this.txtIP.text,int(this.txtPort.text));
}
private function onConnected(evt:Event):void
{
xmlsocket.send(this.txtTrueName.text+" has connected");
this.txtContent.text=this.txtContent.text+"Á¬½Ó³É¹¦\n";
}
//·¢ËÍÐÅÏ¢
private function Send():void
{
this.xmlsocket.send(this.txtTrueName.text+"|"+this.txtSendContent.text+"\n");
}
//½ÓÊÕÊý¾Ý
private function OnRecived(event:DataEvent):void
{
trace("µÈ´ý¶ÁÈ¡Êý¾ÝÐÅÏ¢");
tmpStr = event.text;
//alert=Alert.show("ÊÕµ½ÐÂÏûÏ¢","ÏûÏ¢");
this.txtContent.text=this.txtContent.text+"\n"+tmpStr;
}
]]-->
</fx:Script>
<fx:Declarations>
<!-- ½«·Ç¿ÉÊÓÔªËØ£¨ÀýÈç·þÎñ¡¢Öµ¶ÔÏ󣩷ÅÔÚ´Ë´¦ -->
</fx:Declarations>
<s:Panel right="0" left="0" top="0" bottom="0" horizontalCenter="left">
<mx:TextInput borderColor="#070D04" borderStyle="inset" id="txtIP" text="192.168.1.99" left="88" top="23"/>
<mx:TextInput borderColor="#070D04" borderStyle="inset" width="94" id="txtPort" text="6666" left="293" top="23"/>
<mx:TextInput borderColor="#070D04" borderStyle="inset" width="94" id="txtTrueName" t
Ïà¹ØÎĵµ£º
ºÜ¾ÃûȥÁ·Ï°flex ¿ªÊ¼ÓеãÉúÊ裬ÓÃÆðÀ´»¹ÊǺÜÊæ·þ¡£flex 3ºÍflex4Ö®¼ä´æÔÚһЩ²î±ð£¬ËùÒÔÔÚÑ¡ÔñµÄʱºòÐèҪСÐÄÒ»µã£¬½ñÄêÖ÷ÍÆflex 4 ËùÒÔ³õѧµÄÈË¿ÉÒÔÌø¹ýflex 3Ö±½Óѧflex4¡£ ÒòΪflex ¿ª·¢Êǽ¨Á¢ÔÚas 3»ù´¡ÉÏ£¬¹Ê´ËÑо¿Àà¿âÖ®¼ä½á¹¹ÊÇÒ»¼þºÜ²»´íµÄÊÂÇé¡£±Ï¾¹½á¹¹ÃÀÊÇѧϰ±à³ÌÒ»ÖÖÃÀѧÁ÷¡£
½ñÌìµÄ´¿´âÁ·Ï° ......
Ëæ×Å Adobe Flex ¼¼ÊõµÄ³ÉÊ죬ԽÀ´Ô½¶àµÄÆóÒµ¿ªÊ¼²ÉÓà Adobe Flex ¼¼Êõ¿ª·¢ RIA (Rich Internet Application)¡£ÔÚ³£¼ûµÄ RIA Ó¦ÓóÌÐò¼Ü¹¹ÖУ¬¿Í»§¶ËÓà Adobe Flex äÖȾ³öƯÁÁµÄ½çÃ棬¶øäÖȾ½çÃæËùÐèÒªµÄÊý¾ÝÔò´Ó·þÎñÆ÷¶ËµÄÓ¦ÓóÌÐò»ñÈ¡¡£ÔÚ Java EE ÁìÓò£¬·þÎñÆ÷¶ËµÄÓ¦ÓóÌÐòͨ³£ÊÇÔ ......
ÓùýFLEXÖÐStringÀàÐ͵ÄÅóÓÑ¿ÉÄÜÖªµÀ£¬replaceÕâ¸ö·½·¨²¢²»¹ýÌæ»»ËùÓÐÄÚÈÝ¡£ÄÇôÎÒÃÇÐèÒªÌæ»»ËùÓÐÄÚÈÝÔõô°ì£¿Ö»ÓÐ×Ô¼º¶¯ÊÖ£¬·áÒÂ×ãʳ¿©£¬ºÇºÇ¡£ÑÔ¹éÕýר£¬ÓÐÁ½ÖÖ·½·¨£¬Ò»ÖÖÊÇÀûÓÃArrayµÄ·½Ê½£¬ÁíÒ»ÖÖÊÇÀûÓÃÕýÔòÈ¥Ìæ»»¡£
/**
* StringReplaceAll
* @param source:String Ô´Êý¾Ý
* @param find:String Ìæ»»¶ÔÏó ......
×î½üÓöµ½ÁËflex µÄ°²È«É³ÏäÎÊÌ⣬ÕÒÁ˺ܶà×ÊÁÏ·¢ÏÖ²»ÊǶ¼ÊǺÍÎÒ£¬ÎҵijÌÐòÐèÒªsocketÁ¬½Ó£¬¶ø´ó¶àÊý½²µÄ¶¼ÊÇ¿çÓòÎļþ¶ÁÈ¡µÄ¡£ÎÒÏÈ°ÑÁ½ÖÖ·½·¨¶¼×ܽá³öÀ´£º
¿çÓòÎļþ¶ÁÈ¡
·½·¨Ò»£ºÔÚÄ¿±ê·þÎñÆ÷Éϲ¼Êðcrossdomain.xmlÎļþ(ÎÒÓõĴ˷½·¨ºÜ¹ÜÓ㬷ÅÉϾÍûÎÊÌâÁË) ÐèÒªÔ¶³Ì·þÎñ¸ùĿ¼¶¨ÒåÓÐcrossdomain.xmlÎļþ£¬ÈçÏ£º
<?x ......
Flex ºÍC++ Ö®¼ä´«Êä½á¹¹ÌåÊý¾Ý
Ò»Ö±ÏëÊÔÑéÓýṹÌå´«Êý¾Ý
µ«ÊÇFlex ºÍC++ µÄÀàÐÍËùÕ¼µÄ×Ö½ÚÊýÓÐʱ²»Ò»Ñù
Èçint ÔÚC++ÖÐÕ¾2¸ö×Ö½Ú£¬¶øÔÚFlexÖÐÕ¼4¸ö×Ö½Ú¡£
ת»»±È½ÏÂé·³¡£
×îºó¾ö¶¨ÓÃXML½øÐд«Êä
È»ºóÁ½±ß¶¼¼ÓÒ»¸öXML ½âÎöºÍ·â×°Àà¡£
C++ ¶ËʹÓõÄtinyXML Àà
FlexÖ±½ÓʹÓÃ×Ô¼º´øµÄ E4X Àà
Flex´úÂëÈçÏÂ
&nb ......