Using Flash with open social

Open Social is a google api for social applications across multiple websites. With standard JavaScript and HTML, we can create apps that access a social network’s friends and update feeds.

I have used social api to create the Orkut Application, and found that it’s really very very easy to build orkut app.

Here is the sample app xml which you can use to create your orkut app.

//—– XML Starts from here


<?xml version="1.0" encoding="UTF-8"?>
<Module>
 <ModulePrefs title="____YOUR_APP_TITLE____">
  <Require feature="opensocial-0.7"/>
 </ModulePrefs>
 <Content type="html"><![CDATA[
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="765" height="500" id="____YOUR_APP_ID____(This is name of your swf file with out extention, not orkut application id)" align="middle">
 <param name="allowScriptAccess" value="always"/>
 <param name="movie" value="____FULL_PATH_OF_YOUR_SWF____"/>
 <param name="quality" value="high"/>
 <param name="bgcolor" value="#ffffff"/>
 <embed src="____FULL_PATH_OF_YOUR_SWF____" quality="high" bgcolor="#ffffff" width="765" height="500" name="____YOUR_APP_NAME____" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>
</object>
    ]]></Content>
</Module>

 

//—–XML Ended

 

Now some points to remember

1. When you copy this code to any editor, don’t forget to replace smart-qoute with standard quotes.

2. As Application is on your domain only use full path like http://www.yoursite.com/yourfolder/yourfile.swf for all images, mp3, js or any file used in your app.

3. Use crossdomain policy file.

//—- Save this as crossdomain.xml and put it on same folder, where your .swf recides

<?xml version=”1.0″?>
<!DOCTYPE cross-domain-policy SYSTEM “http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd“>
<cross-domain-policy>
<allow-access-from domain=”*” />
</cross-domain-policy>

//—

Please update “allow-access-from domain” as per your need.

4. For any commnocation with social api use External Interface.

5. In object tag update “param-name” “allowScriptAccess”, from “sameDomain” to “always”

6. When you update the .xml file use &bpc=1 in URL, it will bypass the Orkut Application XML Cacheing, e.g. http://sandbox.orkut.com/Application.aspx?uid=XXXXXXXXXXXX&appId=XXXXXXXX&bpc=1

Here are some useful Links

 Getting Started Videos (Must see!!!!!!!!!!!!!!!!!!!)

http://www.youtube.com/view_play_list?p=5F0F046F77B7B62A

OpenSocial API Documentation

http://code.google.com/apis/opensocial/docs/index.html

OpenSocial API Developer’s Guide (v0.7)

http://code.google.com/apis/opensocial/docs/0.7/devguide.html

Orkut Documentation

http://code.google.com/apis/orkut/docs/index.html

Orkut Developer’s Guide

http://code.google.com/apis/orkut/docs/orkutdevguide.html