Posts

Showing posts from 2010

Prototype based programming

Image
Prototype-based programming is a style of object oriented programming. Prototype based porgramming encourages the programmer to focus on the behavior of some set of examples and only later worry about classifying these objects that are later used in a fashipn similar to classes. Prototype based programming is also known as class-less, prototype-oriented or instance-based programming. Classless programming style is supported by the following programming languages. JavaScript, ActionScript , Lua Open Laszlo In prototype based programming behaviour resues ( known as inheritance in class-based languages) is performed via a process of cloning existing objects that serve as prototypes. Cloning refers to a process whereby a new object is constucted by copyin the behavior of an existing object (its prototype). The new object then carries all the qualities of the original. From this point on, the new object can be modified. The resulting child object maintains an explicit link...

What is Adobe Flash ?

Image
Image via Wikipedia What is Flash ? Adobe Flash CS4 is a powerful multimedia creation tool used to create and display animation, video, and sound content. It can be also used to create Interactive Rich Internet Application (RIA). Flash can work with: Bitmap Graphics, Sound - you can change the compression of a sound by opening the Sound Properties window Video What are different Flash File types? Following are the different Flash file types: 1) Flash File (.FLA) - Flash working file (while creating artwork) 2) Flash Movie(.SWF) - contains Flash content which can be played in the Flash Player. 3) Video (.FLV, .F4V, .MP4) - These are video file type supported by Flash Player. Existing Movies can be converted to these format using Adobe Media Encoder which is included in Adobe Flash CS4. When you import a video into Flash the controls to play back the video is automatically added. 4) ActionScript File (.AS) - file containing Actionscript code. Using ActionScript you c...

Accessing File System

import flash.filesystem.*; public class MyFile { private var stream: FileStream; private function saveFile(): void { var file:File = File.desktopDirectory.resolvePath("file.txt"); var stream:FileStream = new FileStrem(); stream.open(fiel, FileMode.WRITE); var str:String = "file content"; stream.writeUTFBytes(str); stream.close(); } }

Building a Flex Custom Component Using ActionScript

// MyComboxBox.as package mycomponets; { import mx.controls.ComboBox; public class MyComboBox extends ComboBox { public function MyComboBox() { dataProvider = ["Hyderabad", "Bangalore", "Pune", "Noida"]; } } }

Generating random numbers within a given limit using ActionScript 3.0

Math.round(Math.random() * (high - low)) + low;

Language Basics - Part 2

Fundamental Data Types String : for storing text Numeric : ActionScript 3.0 provides three specific data types for numeric data: Number : any numeric value, including values with or without a fraction int : an integer (a whole number without a fraction) uint : an "unsigned" integer, meaning a whole number that can't be negative Boolean : a true-or-false value, such as whether a switch is on or whether two values are equal. Class In ActionScript object-oriented programming, a class contains three types of characteristics: Properties - encloses data within a class Methods - encloses action that can be performed by the class intanses. Events - helps the class intanses to listen and respond to certain user actions or happenings

Language Basics - Part 1

This blog will help you getting started with ActionScript programming. Below are the Actionscript programming fundamentals: Statement In ActionScript, each statement is written with a semicolon at the end. Variable Consists of following parts: The variable's name The type of data that can be stored in the variable The actual value stored in the computer's memory var variable:Number = 17; Constant Is a kind of variable which can only be assigned a value one time in the course of an ActionScript application. const TAX_RATE:Number = 0.12; Once a constant's value is assigned, it is the same throughout the ActionScript application.