技术开发 频道

用flex/flash开发opensocail应用

    【IT168技术资讯】推荐一个编写opensocial 应用的工具Google Gadget Editor [ rurl.org/sca ] 是 一个 iGoogle Gadget。登录 Google 后打开这个链接,就可以开始编辑Gadget 的 XML 文件,然后保存成一个公开的 URL,您的 Gadget 就可以使用了。请把 helloworld.xml 的内容复制粘贴替换Gadget编辑器中的代码,另存为其他文件进行测试。其中存好的 XML 文件的 URL 在编辑框的右上角。
提供了预定的模板,比Editplus或ue好多了.

    1. Actionscript版openSocial API(官方地址)
http://code.google.com/p/opensocial-as3-client/

    2.下载其源代码,其中包含了一个样例(SampleApp.mxml)

    3.参考其Developer's Guide

    4.编写the spec XML (testFlash.xml)
 

<?xml version="1.0" encoding="UTF-8" ?>
<Module>
<ModulePrefs title="testFlash3" height="500" scrolling="true" author="qsf" width="800" description="qsftest1"
thumbnail="http://img0.gmodules.com/ig/images/igoogle_logo_sm.gif"
author_email="your.email@foo.bar" >
<Require feature="flash"/>
<Require feature="views"/>
<Require feature="dynamic-height"/>
<Require feature="opensocial-0.8"/>
</ModulePrefs>
<Content type="html">
<!--[CDATA[
<!-- The JS-Side javascript code lib used in the Flash API. -->
<mce:script src="http://dream8062qu.appspot.com/opensocial-flashsdk.js" mce_src="http://dream8062qu.appspot.com/opensocial-flashsdk.js" type="text/javascript"></mce:script>
<!-- The flash element -->
<div id="flashcontainer" style="text-align: center;" mce_style="text-align: center;"></div>
<!-- Embed the swf file -->
<mce:script type="text/javascript"><!--
opensocial.flash.embedFlash(
"http://dream8062qu.appspot.com/SampleApp.swf",
"flashcontainer", "9", {
width: "600",
height: "500",
quality: "high",
wmode: "window",
allowScriptAccess: "always"
});
gadgets.window.adjustHeight();
// --></mce:script>
]]-->
</Content>
</Module>
 


 

    5.上传文件

将testFlash.xml,opensocial-flashsdk.js, SampleApp.swf一起上传质公网地址.

    6.测试,进入orkut网站,同上添加http://dream8062qu.appspot.com/testFlash.xml,即可进行测试.

    注:目前客户端as库目前还不支持rpc调用.

 

0
相关文章