Flex ¼¯ºÏ(ArrayCollection)
¹Ø¼ü×Ö: flex, arraycollection
¼¯ºÏÊÇActionScript Öй¦ÄÜÇ¿´óµÄ»ùÓÚË÷ÒýµÄÊý×é×é¼þ£¬Ìí¼ÓÁËÈç¶ÔÄÚÈݽøÐÐÅÅÐòµÈ¹¦ÄÜ£¬
²Ù×÷Êý×éµÄ¶ÁȡλÖ㬴´½¨¾¹ýÅÅÐòµÄÊý×éÊÓͼ¡£¼¯ºÏÒ²ÄÜ֪ͨÆäÈÎÒâʼþ¼àÌýÆ÷¼àÌýÆäÊý
¾ÝÊÇ·ñ¸Ä±ä£¬ÒÔ¼°ÈκÎÊý¾ÝÏî±»Ìí¼Óµ½Ô´Êý×éʱ¿ÉÖ´ÐÐ×Ô¶¨ÒåÂß¼¡£µ±Êý¾Ý¸Ä±äʱ¿É֪ͨÆä
¼àÌýÆ÷£¬ÕâÊǼ¯ºÏµÄй¦ÄÜ£¬½ÐÊý¾Ý°ó¶¨£¬»¹ÓоÍÊÇÔÊÐíDataGrid ºÍList ×é¼þ¶ÔÆäÄÚÈݽø
ÐÐÅÅÐòºÍ¹ýÂË¡£¼¯ºÏÊÇʹÓÃÊý¾ÝÇý¶¯¿Ø¼þÒÔ¼°´ÓÊý¾Ý¿â·µ»ØµÄ·þÎñÆ÷¶Ë·þÎñµÄÖØÒªÄÚÈÝ¡£
¾³£±»Ê¹ÓõÄÁ½¸ö¼¯ºÏÀàÐÍÊÇArrayCollection ÀàXMLListCollection Àà¡£ArrayCollection ÊÇ
Array µÄ°ü×°À࣬Ìṩ¸ü·½±ãµÄÈçÌí¼ÓºÍÒÆ³ýÊý¾ÝÏîÒÔ¼°Äܹ»´´½¨ÓαêÆôÓÃÒªÇáËɵش洢Êý
×éÖеÄ×îºó¶ÁÈ¡µÄλÖõȷ½·¨¡£¶øXMLListCollection ÊÇXML ¶ÔÏóµÄ°ü×°À࣬ÌṩµÄ¹¦ÄÜ
ÓУº¸ù¾ÝË÷Òý·ÃÎÊÊý¾Ý£¬Ìí¼ÓжÔÏóÒÔ¼°ÓαêµÈ·½·¨¡£XMLListCollection ¶ÔÓÚ´¦ÀíXML ¶Ô
ÏóÒÔ¼°¾³£ÐèÒª½âÎöXML ΪÊý×éÊ±ÌØ±ðÓÐÓá£
ʹÓÃaddItemAt »òaddItem ·½·¨²åÈë¶ÔÏóµ½ArrayCollection £¬
getItemIndex »òcontains ·½·¨ÓÃÓÚ¼ì²âÊý¾ÝÏîÊÇ·ñÒÑ´æÔÚÓÚÊý×éÖУ¬¶øArrayCollection µÄsort
ÊôÐÔÊǶÔArrayCollection ÅÅÐòÒÔ¼°Í¨¹ýij¸ö×ֶξö¶¨½ÓÊÕµÚÒ»¸ö»ò×îºóÒ»¸öÊý¾Ý¡£
Flex´úÂë
<mx:Script>
<![CDATA[
import mx.collections.SortField;
import mx.collections.Sort;
import mx.collections.ArrayCollection;
private var coll:ArrayCollection;
private function init():void {
coll = new ArrayCollection(
[{name:"Martin Foo", age:25},
{name:"Joe Bar", age:15},
{name:"John Baz", age:23}]);
}
Òª²åÈëÔªËØµ½Ö¸¶¨Î»Ö㬿ÉʹÓÃaddItemAt ·½·¨£º
private function addItem():void {
coll.addItemAt({name:"James Fez", age:40}, 0);
}
]]>
</mx:Script>
<mx:Script>
<![CDATA[
import mx.collections.SortField;
import mx.collections.Sort;
import mx.collections.
Ïà¹ØÎĵµ£º
¼¸ÈÕǰ±»ÀÏ×ÜÍÆ¼öÎÄÕÂһƪ£¬À´×Ô7yueÐÖµÄblog,×÷ÕßÊÇSean Moore ,
ÔÎĵØÖ·£ºhttp://www.insideria.com/2009/04/51-actionscript-30-and-flex-op.html
ÓëÆäÔÚ³ÌÐòдÍêÁËÖ®ºóÓ·Ö×µÃÅܲ»¶¯£¬²»ÈçÆ½Ê±×¢ÒâÕâЩ¹Ø¼üµã£¬Ê±Ê±ÌáÐÑ×Ô¼º¡£·Òë³öÀ´£¬ÒÔ±ãÒÔºóʱʱ²éÔÄ¡£
1 ´´½¨ÐÂÊý×éʱ±ÜÃâʹÓÃËüµÄ¹¹Ô캯Êý¡£
......
amf3,adobe´´Á¢µÄÊý¾Ý¸ñʽÓÉÓÚʹÓöþ½øÖÆ,ûÓÐÁËxmlµÈÈßÓàµÄ×Ö·ûÊý¾ÝÁ¿»áÉٺܶà!¶øÇҺܶà²âÊÔ±¨¸æ¾ù²â³öamf´«µÝЧ¹ûºÜ¸ß.
Õâ´ÎÊÇʹÓÃFlexµÄSocketÀàÓëjavaµÄ·þÎñ¶Ë½øÐÐͨÐÅ,
²½ÖèÊÇ:
¿Í»§¶ËÓÃsocketÀàÁ¬½Ójava·þÎñÆ÷,
ʹÓòéѯ×Ö·û´®½øÐÐÇëÇó,
java½«Êý¾Ý·âװΪhashmap,×îºó½«hashmapÓÃamfoutputstreamÊä³öÖÁflexµÄ¿Í» ......
//»ñµÃÆÁÄ»µÄ·Ö±æÂÊ
var
x:Number=Capabilities.screenResolutionX;
var
y:Number=Capabilities.screenResolutionY;
Alert.show(
"x="
+x+
"y="
+y);
µÚ¶þÖÖ·½·¨
Alert.show(stage.fullScreenWidth+
"=="
+stage.fullScreenHeight);
//»ñµÃstage£¨¹¤×÷Çø£ ......
1.¸´ÖÆÄÚÈݵ½ÏµÍ³¼ôÌù°å
System.setClipboard(strContent);
2.¸´ÖÆÒ»¸öArrayCollection
//dummy solution( well, it works )
var bar:ArrayCollection = new ArrayCollection();
for each ( var i:Object in ac ){
bar.addItem( ......
»·¾³£ºeclipse 3.5 + tomcat 6.0 + flex builder 3.0 + blazeds-turnkey-3.2.0.3978.zip£¨adobeÍøÕ¾ÉÏÏÂÔØ£©
(ÒòΪ²»ÄܷŽØÍ¼ËùÒÔÖ»ÄÜÐðÊöÁË)
1£¬Ð½¨Ò»¸ö
java web
ÏîÄ¿ ÀýÃûΪ :testjava;
2,Ôڴ˹¤³ÌÖÐдһ¸ö¼òµ¥µÄÀà:
package cn.com;
  ......