Thursday, July 7, 2011

Associative arrays in ActionScript 3

The Array class provides methods and properties that work with number-indexed arrays only--and not with associative arrays. Associative arrays should be instances of the Object class.

Technically, since the Object class is the base class for all ActionScript classes, all ActionScript objects can be used as associative arrays. However, unless you have some specific reason for using another class as an associative array, it is best to simply use the generic Object class.

var memebers:Object = {scribe: "Franklin",
                      chairperson: "Gina",
                       treasurer: "Sindhu"};
var members:Object = new Object( );
members.scribe = "Franklin";
members.chairperson = "Gina";
members.treasurer = "Sindhu";
var members:Object = new Object( );
members["councilperson"] = "Ruthie";
trace(members.councilperson);         // Displays: Ruthie
members.councilperson = "Rebecca";
trace(members["councilperson"]);      // Displays: Rebecca
More information at the source:

Friday, September 10, 2010

Inspiring Quote by Steve Jobs

Remembering that I’ll be dead soon is the most important tool I’ve ever encountered to help me make the big choices in life. Because almost everything — all external expectations, all pride, all fear of embarrassment or failure — these things just fall away in the face of death, leaving only what is truly important. Remembering that you are going to die is the best way I know to avoid the trap of thinking you have something to lose. You are already naked. There is no reason not to follow your heart.

Sunday, September 5, 2010

Upgrade your WordPress site or blog for free..

Yes, you heard that right... got a WordPress site or blog ? if yes, MULTIDOTS offers free upgradation to latest version of WordPress.

visit :

Its a campaign cum activity started by WordPress group at MULTIDOTS.
So hurry up and avail yourself of new features offered by latest version of wp....

Thursday, August 5, 2010

jQuery: How to submit a form with AJAX in jQuery

Excellent explanation of how to submit a form with ajax using jquery - visit :

jQuery: Access value of selected/checked radio button

if you have a group of radio buttons (grouping done using same value for name attribute in all) and you want to get value of selected radio button out of them,
using jquery you can do that with below code snippet:

Suppose you have:

Diya [name="bolly",value="diya"]
Kareena [name="bolly",value="kareena"]
Katrina [name="bolly",value="katrina"]

var sel_val = $('input:radio[name=bolly]:checked').val();

You will get: sel_val = "diya"

For more reference:

Monday, June 28, 2010

Javascript: Inline javascript function in event handler declaration

If you want to write javascript function code directly in the onclick event handler declaration instead of using a separate function for that code, you can do it as follows:

<input type="button" value="Save" onclick="javascript:(function(){ //your code; })();"/>

Monday, May 31, 2010

Google Maps: Best Fit Zoom Level and Center Point.

If you are working with Google maps and have an array of latitude longitude points to plot as markers on map, then you might need to calculate the best fit zoom level and map center point so that all the lat lng points can accommodate comfortably. Here's the code snippet:
// map: an instance of GMap2
// latlng: an array of instances of GLatLng
var latlngbounds = new GLatLngBounds();
for (var i = 0; i < latlng.length; i++)

For further reference: