FLEXºÏ²¢Êý×é
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Script><!--[CDATA[import mx.collections.ArrayCollection;
public var a1:ArrayCollection = new ArrayCollection ([{ Region:"Region1",Territory:"Territory1",Territory_Rep:"Territory_Rep1",Actual:11,Estimate:111}]);
public var a2:ArrayCollection = new ArrayCollection ([{ Region:"Region2",Territory:"Territory2",Territory_Rep:"Territory_Rep2",Actual:22,Estimate:222}]);
public var a3:ArrayCollection = new ArrayCollection ([{ Region:"Region3",Territory:"Territory3",Territory_Rep:"Territory_Rep3",Actual:33,Estimate:333}]);
public var a4:ArrayCollection = new ArrayCollection ([{ Region:"Region4",Territory:"Territory4",Territory_Rep:"Territory_Rep4",Actual:44,Estimate:444}]);
public var a5:ArrayCollection = new ArrayCollection ([{ Region:"Region5",Territory:"Territory5",Territory_Rep:"Territory_Rep5",Actual:55,Estimate:555}]);
public var dpFlat:ArrayCollection=new ArrayCollection(a1.toArray().concat(a2.toArray().concat(a3.toArray()).concat(a4.toArray()).concat(a5.toArray())))
import mx.events.ItemClickEvent;
private function Switch(event:ItemClickEvent):void {var keycode:int=event.index;
switch(keycode){//ÉÏÏÂ×óÓÒcase 0:grid.dataProvider=a1;break;case 1:
grid.dataProvider=a2;break;case 2:grid.dataProvider=a3;break;case 3:
grid.dataProvider=a4;break;case 4:grid.dataProvider=a5;break;case 5:
grid.dataProvider=dpFlat;break;}}]]--></mx:Script><mx:Panel
layout="absolute"title="Êý¾ÝºÏ²¢"horizontalCenter="0"
verticalCenter="0" height="220" width="500">
<mx:DataGrid id="grid" dataProvider="{a1}" right="0" bottom="0" top="0" left="0"/>
<mx:ControlBar horizontalAlign="right" ><mx:Spacer width="10%"/>
<mx:ToggleButtonBaritemClick="Switch(event);"bottom="2" id="ToggleButtonBar"
horizontalCenter="0"><mx:dataProvider><mx:Array>
<mx:String>µÚÒ»</mx:String><mx:String&
Ïà¹ØÎĵµ£º
FlexÊÇ¿ª·¢RiaµÄÀûÆ÷£¬FlashÔÚ¶¯» ÓÎÏ·µÈ·½Ãæ½ÏÇ¿´ó£¬¿ÉÒÔÖÆ×÷³ö¸üÉú¶¯ ÐÎÏ󣬸»ÓÐÀÖȤÐԵĽ»»¥²úÆ·À´¡£
ÔÚ¶àÊýÇé¿öÏÂÐèÒª2Õß½áºÏ¡£
Á½ÕßÖ®¼äµÄͨѶÊÇÒÀ¿¿Ê¼þ»úÖÆÍê³ÉµÄ¡£
ÒÔϵÄÀý×ÓÊÇ£ºFlashÌá½»Êý¾Ý¸øFlex£¬Flex¸Ä±äFlashµÄÊý¾Ý¡£
1£ºFlash CS4¹¤¾ß´ò¿ª
°´ÈçÏ ÊôÐÔ ÖÆ×÷½çÃæ
2£º°´ F9 £¬ÊäÈëÒÔÏ´úÂ룺
......
<?
xml
version
=
"1.0"
?>
<!-- Simple example to demonstrate the Alert control. -->
<
mx:Application
xmlns:mx
=
"http://www.adobe.com/2006/mxml"
>
&n ......
flexÖÐÔÚDisplayObjectÀïÖ±½ÓÓÃstage£¬¿ÉÄÜ»áÊÇnull£¬ÔÒò²»ÊÇÌ«Çå³þ£¬ÕÒµ½Á˽â¾ö°ì·¨£¬µ±½ÓÊÕµ½ADDED_TO_STAGEʼþʱ£¬stage¿Ï¶¨±»´´½¨³öÀ´ÁË£¬Õâ¸öʱºòÔÙʹÓþÍûÓÐÎÊÌâ¡£
addEventListener( Event.ADDED_TO_STAGE, function( e:Event ):void ??
{
stage.addEventListener(KeyboardEvent.KEY_DO ......
Æäʵ¶ÔÓÚÕâ¸öÌâÄ¿ÊDz»Ç¡µ±µÄ£¬ÒòΪflexÖÐÊÇûÓÐÒ³ÃæÕâ¸ö¸ÅÄîµÄ£¬Ò³ÃæÔÚflexÀïÃæÆäʵ¾ÍÊÇÒ»¸ö¸öµÄCanvas£¬vbox£¬
hboxµÈµÈÖ®ÀàµÄ¶«Î÷£¬¿´µ½µÄ²»Í¬Ò³ÃæµÄÇл»£¬¾ÍÊÇÕâÐ©ÔªËØÒ»²ã²ãµÄ¶Ñ»ý£¬»òÕßÌæ»»£¬µ«ÊÇΪÁ˺ÃÀí½â£¬»¹ÊdzÆÖ®Îª
"Ò³ÃæÌø×ª"¡£ÆäʵÎÒÃÇ¿ÉÒԶԱȴ«Í³µÄC/S¿ª·¢Ä£Ê½£¬Ã»Ò³ÃæÌø×ª£¬Ö»Óд°ÌåºÍÔª¼þµÄÏÔʾºÍÒþ²Ø¡ ......
ÏëÔÚflexÖÐÕæÊµµÄÏÔʾhtml,µ«ÊÇtexteara,lable,textÖÐÖ»Ö§³Ö²¿·Öhtml±êÇ©
<a>¡¢<b>¡¢<br>¡¢<font>¡¢<img>Èç¹ûÓÃimgÓÖ´æÔÚÏÔʾ×Ô¶¯»»ÐеÄÎÊÌâ¡£Ö»ÓвÉÓÃǶÈëhtmlµÄ·½·¨À´½â¾ö¡£
1.flexdemo1
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe ......