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"?>
 <ModulePrefs title="____YOUR_APP_TITLE____">
  <Require feature="opensocial-0.7"/>
 <Content type="html"><![CDATA[
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase=",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=""/>


//—–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 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 ““>
<allow-access-from domain=”*” />


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.

Here are some useful Links

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

OpenSocial API Documentation

OpenSocial API Developer’s Guide (v0.7)

Orkut Documentation

Orkut Developer’s Guide

Life’s Little Instruction Book

This sunday I found a wonderful book. Name is “Life’s Little Instruction Book” by H. Jackson Brown, Jr.

It is having 1500+ advices rather instructions. here is some for you all.

Life's Little Instruction Book

  • Compliment three people everyday
  • Watch sunrise at least once a year
  • Remember other people’s birthdays
  • Learn to play any music instrument
  • Buy great books, even if you never read them
  • Learn to make delicious food
  • Be the first one to say “Hello.”
  • Plant a tree on your birthday
  • Make new friends but cherish the old ones
  • Never giveup on anybody, Miracles do happen every day
  • Always put cap back on toothpaste
  • Vote
  • Give to charity all the clothes you haven’t worn during the past year
  • Don’t Smoke
  • Refill water bottle after drinking
  • Think big thoughts, but relish small pleasures
  • Never Cheat
  • Learn to identify local flower, birds and trees
  • Remember peoples name
  • Turn off the TV at dinner time
  • Be your wife’s best friend
  • Show respect for all living things
  • Never cut what can be untied
  • Make video of your parents memories of how they met and their first year of marrige
  • Hire people smarter than you
  • As soon as you get married, start saving for yout childrens education
  • Choose a seat next to the emergency exit when flying. you will get more leg room
  • Remember the ones who love you
  • Remember that it’s better to cheat in price than in quality
  • Be happy for what you have while working for what you want
  • Be grateful thatgod dosen’t answer all your prayers
  • Don’t take good friend, good health or a good marriage for granted

Hope you’ll find it interesting too.

web site of H. Jackson Brown, Jr

Buy this book from Amazon

Fake Gravity Algo


This is the fake Gravity algo. I have copied this from book “Flash MX 2004 Game Design”.

//————– Copy from here ——————-

// Object require on Stage

// ball:MovieClip – Idally with a circle or whatever you want.

var ymov:Number = 0;
var gravity:Number = 2;
ball.onEnterFrame = function() { 
 ymov += gravity;
 ball._y += ymov;
 if (ball._y>(Stage.height – ball._height)) {
  ball._y = Stage.height – ball._height;
  ymov *= -1;

//————– Stop Copying ——————-

Tween Class

Tween class is preety smilple and very very useful. I have not used it till last month and after using it I always think that If I had spend 1hr on this class before 2 years, Icould make many application more interesting. (Specially some Drag & Drops)

Here is one example of Tween Class.

You need to put one movieClip named “mcObject” on Stage and paste the code in Action Layer.

//————– Copy from here ——————-

import mx.transitions.Tween;

import mx.transitions.easing.*;


var mcObject:MovieClip;


mcObject.onPress = pressHandler;

mcObject.onRelease = mcObject.onReleaseOutside=releaseHandler;


function pressHandler() {

//trace(“pressHandler called with [“+arguments+”]”);

this.oldX = this._x;

this.oldY = this._y;




function releaseHandler() {

//trace(“releaseHandler called with [“+arguments+”]”);


var xTween:Tween = new Tween(this, “_x”, Bounce.easeOut, this._x, this.oldX, 5, true);

var yTween:Tween = new Tween(this, “_y”, Bounce.easeOut, this._y, this.oldY, 5, true);


//————– Stop Copying ——————-

You can take offical help on Tween class from here