要把一个字符串传到Flex前台~ 已经写好,结果又需要传多一个,不想改太多~
正好闲来无事,就想用用Json~
其实也很简单,就改一点点~(仅示改动地方)
...
import com.adobe.serialization.json.JSON;
...
private function someHandle():void {
//get the raw JSON data and cast to String
var rawData:String = String(event.result);
//decode the data to ActionScript using the JSON API
//in this case, the JSON data is a serialize Array of Objects.
var arr:Array = (JSON.decode(rawData) as Array);
//create a new ArrayCollection passing the de-serialized Array
//ArrayCollections work better as DataProviders, as they can
//be watched for changes.
var dp:ArrayCollection = new ArrayCollection(arr);
//pass the ArrayCollection to the DataGrid as its dataProvider.
grid.dataProvider = dp;
}
一般情况下会没有包含com.adobe.serialization这个包的包,我给附上了~
就这么简单,然后在后台里修改相应返回值为Json格式就行了~
分享到:
相关推荐
corelib.swc 博文链接:https://ioryioryzhan.iteye.com/blog/208138
flex中使用json 含例子和json包
flex json,flex与java进行数据交互是json的相互转化
NOTHING Flex使用json和xml数据交互
在Flex开发中用到的Json包,包括源码都有。com.adobe.serialization.json.JSON。保证好用
flex3 json官方包 flex3 json官方包
flex解析json的swc包(entity-flex-v1-02)及例子
Flex与JSON及XML的互操作,一篇Info的文章。
flex 解析json的包, 用于前台显示,方便操作!
JSwoof是一个当前Flex解释Json最快的工具,是Flex下的包,即当你做Flex+Java的开时,你可以利用JSwoof这个工具包很好地在Java Json格式的数据与Flex中的对象相互转换。 比如JSwoof中的JParser.decode()方法: ...
Flex ssh 读取xml json Flex ssh 读取xml json
用于Flex开发所用的json包,直接解压到工作目录即可
Flex使用JSON格式与Java通信
Adobe官方提供的Flex解析Json的ActionScript包
Flex的JSON解析包,使用的时候记得加引用 import com.adobe.serialization.json.*;
Flex3中用到的工具类包,含有json类,在flex3中用到json的话,这个包很有用哦,src为源码,lib中为swc文件
Flex 解析Json 引入:import json JParser; var uinfo:Object new Object ; uinfo fun "checkMeetingUser"; uinfo uid "12"; uinfo meetId "1"; var strJson:...