之前有改參考這個程式改寫一個 AIR的程式,今天有看到把 flex 3的程式碼改寫成 flex 4的,可以參考看看
Migrating Flex 3 applications to Flex 4.5 – Part 1: Importing the Flex 3 Dashboard application into Flash Builder 4.5
Migrating Flex 3 applications to Flex 4.5 – Part 2: Beginning migration of the Dashboard application to Flex 4.5
Migrating Flex 3 applications to Flex 4.5 – Part 3: Introducing Spark components and simple skins
Migrating Flex 3 applications to Flex 4.5 – Part 4: Using Spark Panel, List, DataGrid, and VGroup components and adding custom skins and states
2013年4月25日 星期四
2012年8月29日 星期三
2011年5月17日 星期二
2011年1月12日 星期三
Flex 存檔 charset問題
目前想在flex 上直接作存檔動作,flash 10 以後的版本可以直接存檔而不用透過server,在實作上有遇到中文亂碼的問題,本來以為使用 bytearray.writeUTFBytes() 的方式就可以解決問題,但後來發現不行,只能用筆記本打開才不會亂碼,用wordpad, excle 打開都是亂碼,看來是我太淺了.............
charset information
後來有找到解決方式如下:
var f:FileReference = new FileReference();
var _txtByte :ByteArray = new ByteArray();
......
......
_txtByte.writeMultiByte(str,"cn-big5"); //繁体中文
f.save(_txtByte, "test.csv");
如果檔案要存成 excel的可以參考如下的文章
參考網址: as3xls 中文解決方式
其方式改寫 excelFile.saveToByteArray 多一個 charset 參數 ,繁体中文可以設定 cn-big5
charset information
後來有找到解決方式如下:
var f:FileReference = new FileReference();
var _txtByte :ByteArray = new ByteArray();
......
......
_txtByte.writeMultiByte(str,"cn-big5"); //繁体中文
f.save(_txtByte, "test.csv");
如果檔案要存成 excel的可以參考如下的文章
參考網址: as3xls 中文解決方式
其方式改寫 excelFile.saveToByteArray 多一個 charset 參數 ,繁体中文可以設定 cn-big5
2011年1月11日 星期二
2010年12月21日 星期二
Flex 與 Java 使用 URLRequest 傳遞中文參數
這個大家應該都會了,只不我想把它記錄下來
1.在 Flex 內使用 encodeURI(instName) 將中文轉成 utf-8 的 string
2.在 Java 接到 request parameter後作轉碼動作 new String(instName.getBytes("iso-8859-1"),"UTF-8");
1.在 Flex 內使用 encodeURI(instName) 將中文轉成 utf-8 的 string
2.在 Java 接到 request parameter後作轉碼動作 new String(instName.getBytes("iso-8859-1"),"UTF-8");
2010年9月10日 星期五
2010年9月9日 星期四
2010年9月8日 星期三
Flex Chart 動態 series
一般的圖表設計,會在 Tag mx:series 內新增多個 series ,然後每個對應不同的欄位 (yField or xField),
因為來自不同欄位,所以可以這樣作,但如果值是來自相同欄位的話,而另一個欄位則儲存分類的類別值,如
不同的 Sales Man就是代表一條線,那要怎麼作呢,這邊有範例可以參考,使用XML方式,而程式碼的部份資料來源是使用 ArrayCollection,應該就可以達成其功能了。
Dynamic Create Series By XML Data Source
coding
try {
var wholist:Array = new Array();
var property:String ;
//partXRData is an arraycollection
for(var i:int =0; i property = partXRData.getItemAt(i).USER_NAME as String;
if (wholist[property] == null){
wholist[property] = new ArrayCollection();
}
(wholist[property] as ArrayCollection).addItem(partXRData.getItemAt(i));
}
var currentSeries:Array = new Array();
var count1:int = 0;
var localSeries:LineSeries = null;
for each (var ac1:ArrayCollection in wholist) {
// Create the new series and set its properties.
localSeries = new LineSeries();
localSeries.dataProvider = ac1;
localSeries.yField = "AVERAGE1";
localSeries.xField = "VALUE_SN";
// Set values that show up in dataTips and Legend.
localSeries.displayName = ac1.getItemAt(0).USER_NAME;
// Back up the current series on the chart.
// Add the new series to the current Array of series.
currentSeries.push(localSeries);
}
// Add the new Array of series to the chart.
avgChart1.series = currentSeries;
}catch(error:Error) {
}
因為來自不同欄位,所以可以這樣作,但如果值是來自相同欄位的話,而另一個欄位則儲存分類的類別值,如
| Sales Man | Date | Amount |
| Sales A | 2010/01/01 | 100 |
| Sales B | 2010/01/01 | 200 |
Dynamic Create Series By XML Data Source
coding
try {
var wholist:Array = new Array();
var property:String ;
//partXRData is an arraycollection
for(var i:int =0; i
if (wholist[property] == null){
wholist[property] = new ArrayCollection();
}
(wholist[property] as ArrayCollection).addItem(partXRData.getItemAt(i));
}
var currentSeries:Array = new Array();
var count1:int = 0;
var localSeries:LineSeries = null;
for each (var ac1:ArrayCollection in wholist) {
// Create the new series and set its properties.
localSeries = new LineSeries();
localSeries.dataProvider = ac1;
localSeries.yField = "AVERAGE1";
localSeries.xField = "VALUE_SN";
// Set values that show up in dataTips and Legend.
localSeries.displayName = ac1.getItemAt(0).USER_NAME;
// Back up the current series on the chart.
// Add the new series to the current Array of series.
currentSeries.push(localSeries);
}
// Add the new Array of series to the chart.
avgChart1.series = currentSeries;
}catch(error:Error) {
}
2010年8月30日 星期一
2010年8月24日 星期二
2010年4月23日 星期五
在Module使用 Clear Data Builder 的問題
vrasputnis
I am judging purely by the underlying Flex error - flex.messaging.io.amf.ASObject
cannot be cast to com.wintek.mids.dto.DeptDTO.
Whenever you use modules, rule #1 is to link Flex DTOs to the application and
NOT to the module. You can use Flex library project, in particular and tune
the CDB to generate Flex DTO's directly into that library. Add that project
as, say, merge-in to the application. To the module add the same project as
extern, because DTO classes will be provided by the parent application domain.
I am judging purely by the underlying Flex error - flex.messaging.io.amf.ASObject
cannot be cast to com.wintek.mids.dto.DeptDTO.
Whenever you use modules, rule #1 is to link Flex DTOs to the application and
NOT to the module. You can use Flex library project, in particular and tune
the CDB to generate Flex DTO's directly into that library. Add that project
as, say, merge-in to the application. To the module add the same project as
extern, because DTO classes will be provided by the parent application domain.
Flex 專案愈長愈大的問題 - include flex library with RSL mode
目前想用flex 幫公司作個系統,但有考慮到使用Flex,所有系統檔案都要下載到Client ,如果以後檔案愈來愈大的話,下載的時間就會變長,所以想一個解決的方法,相關文章如下,簡單的說,使用這種模式就是讓很多專案都可以使用相同的library囉,相對的只要下載一次就好了,參考看看
http://livedocs.adobe.com/flex/3/html/help.html?content=rsl_09.html
不知道在開發silverlight 是不是也是跟我一樣會愈到相同的問題呢
http://livedocs.adobe.com/flex/3/html/help.html?content=rsl_09.html
不知道在開發silverlight 是不是也是跟我一樣會愈到相同的問題呢
2010年3月5日 星期五
Clone Object in Flex 3
以Java 的物件來說,clone 一個Object 只要用object.clone();就可以了
但在Flex 3 要使用 mx.utils.ObjectUtil這個物件,使用類別方法
ObjectUtil.copy(object)這樣就可以產生一個新物件了
但在Flex 3 要使用 mx.utils.ObjectUtil這個物件,使用類別方法
ObjectUtil.copy(object)這樣就可以產生一個新物件了
容易的 Drag Drop 程式 ~~~
使用Flex 3 就可以很容易作 Drag Drop的程式,比Flex 2好寫很多哦
以 List物件來說
方式一:
直接在兩個List 設定 dropEnabled="true" dragEnabled="true" dragMoveEnabled="true" ,這樣就可以相互拖拉所選的項目
方式二:
以我的Flex 作品 3來說, 有一個GridView 可以將資料拉出來(Drag),放至一個垃圾桶(Drop),那我建議的方式為在GridView 設 dragEnabled 屬性設為true dragMoveEnabled 也設為true
,但在 垃圾桶(為一個Image的物件)要有
dragDrop="dragDropHandler(event);"
dragEnter="dragEnterHander(event);"
private function dragEnterHander(event:DragEvent):void {
if (event.dragSource.hasFormat("items"))
{
var data:Array = event.dragSource.dataForFormat('items') as Array;
//這邊可以寫是否要檢查,是否要接受Drag的資料
var dropTarget1:mx.controls.Image = event.currentTarget as mx.controls.Image;
DragManager.acceptDragDrop(dropTarget1);
}
}
private function dragDropHandler(event:DragEvent):void {
if (event.dragSource.hasFormat("items"))
{
// Explicitly handle the dragDrop event.
event.preventDefault();
// Get drop target. var dropTarget:mx.controls.Image=mx.controls.Image(event.currentTarget);
//要讓垃圾桶換圖片
dropTarget.load(trash2Img);
var data:Array = event.dragSource.dataForFormat('items') as Array;
//為一個ArrayCollection新增Drop的資料
trashAC.addItemAt(data[0],0);
}
}
真是太簡單了~~~
以 List物件來說
方式一:
直接在兩個List 設定 dropEnabled="true" dragEnabled="true" dragMoveEnabled="true" ,這樣就可以相互拖拉所選的項目
方式二:
以我的Flex 作品 3來說, 有一個GridView 可以將資料拉出來(Drag),放至一個垃圾桶(Drop),那我建議的方式為在GridView 設 dragEnabled 屬性設為true dragMoveEnabled 也設為true
,但在 垃圾桶(為一個Image的物件)要有
dragDrop="dragDropHandler(event);"
dragEnter="dragEnterHander(event);"
private function dragEnterHander(event:DragEvent):void {
if (event.dragSource.hasFormat("items"))
{
var data:Array = event.dragSource.dataForFormat('items') as Array;
//這邊可以寫是否要檢查,是否要接受Drag的資料
var dropTarget1:mx.controls.Image = event.currentTarget as mx.controls.Image;
DragManager.acceptDragDrop(dropTarget1);
}
}
private function dragDropHandler(event:DragEvent):void {
if (event.dragSource.hasFormat("items"))
{
// Explicitly handle the dragDrop event.
event.preventDefault();
// Get drop target. var dropTarget:mx.controls.Image=mx.controls.Image(event.currentTarget);
//要讓垃圾桶換圖片
dropTarget.load(trash2Img);
var data:Array = event.dragSource.dataForFormat('items') as Array;
//為一個ArrayCollection新增Drop的資料
trashAC.addItemAt(data[0],0);
}
}
真是太簡單了~~~
2010年2月25日 星期四
2010年2月11日 星期四
Flex 作品3 - 儀器管理
網址:
作品Demo
為一個儀器管理系統, MSA, Measurement Systems Analysis,目的可以讓使用者管理儀器,而使用者需定期校正儀器,看其功能是否正常,所以最主要就是可以讓使用者把校正結果明確的記錄下來
開發工具為: Flex builder 3
資料庫整合: Clear Data Builder 3.1 (flash builder 4就不建議用了)
CDB 3.1說明
JAVA Application Server: Glassfish 2.1.1
在glassfish 使用的技術如下:
security :採用 jdbc realm
非同步程式更新:建立一個Queus,並使用Meassage Driven Bean
主要程式:建立一war
作品Demo
為一個儀器管理系統, MSA, Measurement Systems Analysis,目的可以讓使用者管理儀器,而使用者需定期校正儀器,看其功能是否正常,所以最主要就是可以讓使用者把校正結果明確的記錄下來
開發工具為: Flex builder 3
資料庫整合: Clear Data Builder 3.1 (flash builder 4就不建議用了)
CDB 3.1說明
JAVA Application Server: Glassfish 2.1.1
在glassfish 使用的技術如下:
security :採用 jdbc realm
非同步程式更新:建立一個Queus,並使用Meassage Driven Bean
主要程式:建立一war
2009年12月29日 星期二
訂閱:
文章 (Atom)