json和flash

flash 并没有提供对 json 直接支持,不过我们可以通过这个类来实现:JSON.as。然后就可以在 php 中生成类似这样的文件 data.php:

flashVar=[{"url":"中文支持.flv","name":"中文支持"},
{"url":"http://hello.com/1.flv","name":"say hi 1"},
{"url":"http://hello.com/2.flv","name":"say hi 2"},
{"url":"http://hello.com/3.flv","name":"say hi 3"}]

在 flash 中:

import json;
MyVars = new LoadVars ();
MyVars.load ("data.php");
MyVars.onLoad = function (success:Boolean) {
if (success) {
mslist = JSON.parse(this.flashVar);
for(i=0;i<mslist.length;i++){
trace("url:" + mslist[i].url);
trace("name:" + mslist[i].name);
}
}
}
//output
/*
url:中文支持.flv
name:中文支持
url:http://hello.com/1.flv
name:say hi 1
url:http://hello.com/2.flv
name:say hi 2
url:http://hello.com/3.flv
name:say hi 3
*/
这样比单纯用 xml 爽多了。
更多介绍

标签: ,

By sike On 2007年5月15日 星期二 At 15:13 | 2 Comments

利用firebug调试flash


( 点击看大图 )

http://code.google.com/p/flash-thunderbolt/

标签:

By sike On 2007年4月21日 星期六 At 23:11 | 0 Comments

Animator vs Animation 2

http://www.weebls-stuff.com/flash/ava2.swf

标签:

By sike On 2007年4月9日 星期一 At 22:50 | 2 Comments

flash版豆瓣秀





由于豆瓣好像没有 API ,所以这个要用的话有点麻烦,另外还有些地方要改。

标签: ,

By sike On 2007年4月7日 星期六 At 00:49 | 1 Comments

gettheglass 是怎么做出来的

gettheglass 是一个很酷的集交互、讲故事于一身的 flash 游戏。这里显示了它是怎么做出来的。

标签:

By sike On 2007年4月5日 星期四 At 00:29 | 0 Comments

中国移动开始提供flash lite的内容下载


如果手机支持 flash lite 的话,现在可以通过手机的浏览器在 Monternet(移动梦网?)服务的5个分类中下载 flash lite 内容。中国移动现在有3亿5千万的订阅用户。
另外,flash lite 3 会全面支持 flash video ,到2010年会有10亿的手持设备支持 flash。

我们真的需要在手机上看视频吗?
justin.tv 是一个人一天到晚带着个摄像头,然后我们可以实时在网上看到透过它拍到的东西。如果我们不打算在手机上看什么大片,只是想知道发生了什么事,或许手机确实需要视频。

标签:

By sike On 2007年3月31日 星期六 At 16:15 | 1 Comments

人脸合成

实验证明,用30张脸合成出来的比用10张脸合成出来的要好看得多,虽然有时候人们对美难以达成共识,但是符合数学公式的人脸可能更讨人喜欢。
合成的过程是把照片转换成一个 3D 的矩阵( matrix ),然后取各维度的平均值,一般越接近平均值越好看。前段时间在一个电玩厅看到根据夫妇长相生成未来小孩长相的,估计用到了类似的算法。另外虽然 flash8 也引入了 matrix ,但毕竟只是 2D 的,估计无法模拟类似效果。为什么大多数人都认为越狱的男主角长得帅(多国混血),可能就是长得接近平均值。以前在学校经常和某某同学坐在图书馆的大厅看来来往往的彪提浮,看到稍微好看一点的,心中难免感慨:这至少是一张25人脸合成出来的面孔。看到难看的,心中不免感叹:这是一张独一无二的脸,估计不用合成,它代表了它自己。
其实,长成什么样,就像人生中的一些其它事一样,有时我们很难决定的,可能是爹妈给的,或者是数学给的。

标签: ,

By sike On 2007年2月28日 星期三 At 20:16 | 2 Comments

我们全部都是被逼的


我们全部都是被逼的 (需要 flash player 9.0+)

标签: ,

By sike On 2007年1月13日 星期六 At 15:16 | 1 Comments