AS3.0: Add one or more elements to the begining of an array

November 7, 2008 at 5:00 pm (ActionScript) (, )

Written for: ActionScript 3.0

To add one or more elements to the begining of an array, you will have to use unshift method of Array class.

Below is an example.

var albums:Array = new Array("Natty Dread","Rastaman Vibration","Exodus","Kaya");
albums.unshift("Catch A Fire");

trace(albums); //Catch A Fire,Natty Dread,Rastaman Vibration,Exodus,Kaya

Permalink Leave a Comment

System Notifications for AIR application

September 2, 2008 at 6:31 pm (AIR, ActionScript) (, , , , )

Finally, found a way to display system notifications for AIR applications! I’m using as3notificationlib for doing it. From the library’s Google Code page:

This project makes it easy to add cross-platform notifications to your AIR application. It handles “native system notifications” like the dock icon bouncing and the taskbar icon flashing, and it allows you to easily create alert “pop-ups”.

In addition to displaying text in the alert “pop-ups”, one can also add an icon, a video and a sound alert (to indicate display of the “pop-up”).

Permalink Leave a Comment

Difference between Display Object and Display Object Container

August 28, 2008 at 12:07 pm (ActionScript, Flex) (, , , , )

In ActionScript 3.0, anything that appears on the application screen are types of display objects and display object containers are special types of display objects. Though both are visually represented in the application in the same way, the difference between them is that one can add child display objects to a display object container. That means, you can use a Sprite as a display object container and can add shapes, bitmaps, texts,… as child display objects.

Permalink 1 Comment

How to split a pipe(|), comma(,), tab, space,… separated string in ActionScript 3.0

August 21, 2008 at 12:51 pm (ActionScript, Flex) (, , )

To split a pipe(|), comma(,), tab, space,…. separated string into multiple string values in ActionScript 3.0, you will have to use the split() method of String class. Below is short example where in a pipe(|) seperated string is broken up into multiple values and pushed into an array.

var cities:String = "Bombay|Los Angeles|Moscow|London|Rio de Janeiro|Sydney";
var citiesArray:Array = cities.split("|");

trace(citiesArray); //Result: Bombay,Los Angeles,Moscow,London,Rio de Janeiro,Sydney

Permalink Leave a Comment

ActionScript reference guide for RIA development

March 21, 2008 at 11:26 am (ActionScript, Flex) (, )

Found a nice reference guide for ActionScript APIs.

From the site:

This ActionScript reference for rich Internet application development provides an alphabetical reference for all native ActionScript APIs for the Adobe technology platform runtimes: Adobe Flash Player and Adobe AIR—as well as the Adobe Flex framework APIs. Use this guide both as an API reference and a tool to learn about the ActionScript APIs available within the runtimes.

Thanks Adobe!

Permalink Leave a Comment