I’ve found another bug in Flash. I wanted to POST to another site through getURL (I need open new window with some statistics, and must post data as input). I’m using FireFox, but this application must work in IE, so I’ve tested it in there and data was not POSTed. Through GET it works. So I’ve tried many possible solutions, and finally I’ve found, that this is problem of FRAMESET in IE. I’ve tested only IE and FireFox. If you can, please test it with another browsers, and let me know.
http://www.franto.com/blog2/cant-post-data-in-internet-explorer
http://www.franto.com/blog2/cant-post-data-in-internet-explorer?pid=73&rate=2
flex2.0
性能
改善性能
避免多層嵌套容器
一條好經驗是避免容器的嵌套超過三層
用 spacer 對象來填充不需要的空白
絕對定位和縮放
每個容器及其子對象大小和位置的計算會占用大量資源
對象位置固定編碼
使用 Canvas 容器,其它類型的容器(如 Vbox)無法使用絕對位置
將對象寬度和高度固定編碼
可減輕相對布局管理器的處理負荷,從而加速容器和控件的創建
避免的常見容器冗余
<mx:Panel> 標簽中的 VBox 容器
<mx:Application> 標簽中的 VBox
容器作為 MXML 組件的頂層標簽,能不用時可以舍棄
MXML 組件外包上不必要的 VBox 容器來設置某些樣式,可以在組件上設置樣式
重新評價對容器的選擇
改善性能感受
推遲實例化
在可以不必一個屏幕顯示時可以使用
Flex 中的導航條容器(ViewStack、Accordin、TabNavigator)中內置了推遲實例化,默認推遲實例化
creationPolicy="auto,all,none"
漸進式布局
需要一個屏幕顯示,但重繪有效率低時
使用運行時樣式得到良好性能(不宜多用)
注意:第一次最好不要使用setStyle() 方法
樣式使用
<mx:Style> 塊中(作為 MXML 標簽的一個顯式屬性)
外部 CSS 樣式表,(全局樣式)
數據服務
flash 安全沙箱
由于 Flash Player 安全沙箱的存在,對 web 服務的請求只能到 加載 SWF 文件的同一個域。
使用代理(不在同一主機或域)
useProxy="true"屬性直接調用服務。
不使用代理(在同一主機或域)
useProxy="false"屬性直接調用服務。終端服務必須有 crossdomain.xml 文件。
兩種性能最好的發送數據方法是使用 HTTPService 的 XML 和使用 AMF 的 RemoteObject。
Web 服務代理 <mx:WebService>
遠程對象代理<mx:RemoteObject>
HTTP 服務<mx:HTTPService>
實施
預編譯 MXML 頁
預編譯應用程序還能使開發者分發不帶源碼的應用程序。
flex
1.在 mx.swc 看原類中的一些函數
2. cellRenderer,labelFunction
查看 CellRenderer API
3.Effect 使用 改變顯示效果<mx:Effect>
mouseDownEffect
mouseOverEffect
mouseUpEffect
moveEffect
resizeEffect
showEffect
mouseOutEffect
hideEffect
3.其它技巧看 flexbook
JavaScript
1.直接使用 getUrl 使用JavaScript
打開全屏窗口
getUrl(javascript:void(window.open('test.mxml','newwindow','fullscreen=yes,type=fullWindow,scrollbars=no,directories=no,status=no,menubar=no')));
關閉當前窗口(無提示關閉)
getUrl(javascript:window.opener = 'dsg';window.close(););
2.在生成的html 文件中加入 JavaScript ,通過 getUrl使用 JavaScript