Flexcomps’s Weblog

Archive for the ‘AIR’ Category

The Date class constructor is documented with the following parameters in Adobe Docs

Date(yearOrTimevalue:Object, month:Number, date:Number = 1, hour:Number = 0, minute:Number = 0, second:Number = 0, millisecond:Number = 0)

However today i just tried out and found that there is also a undocumented calling of Date constructor with a Date in a string format. I have tried to pass the date as a string and it converts the Date into a actual Date object of AS3 and you can access all the properties of it.

Following is the statement with a Date Constructor as an input with String parameter

trace(new Date("6/13/2008 8:18:15 AM"));

Following is the code for finding and changing BackGround color of all the Input textfields in a perticular scope

//---- Import classes ----------
import flash.utils.getQualifiedClassName;
import flash.text.TextField;
import flash.text.TextFieldType;
//--------- initialize variables ----
var temp:Array;
trace(this.numChildren)
for(var k:int=0;k < this.numChildren;k++){
var child:* = this.getChildAt(k);
if(getQualifiedClassName(child) == "flash.text::TextField"){
var childIns:TextField = child as TextField;
if(childIns.type == TextFieldType.INPUT){
changeBGColor(childIns);
}
}
}

//---- function to change BG color of input boxes ------
function changeBGColor(textFieldObj:TextField){
textFieldObj.background = true;
textFieldObj.backgroundColor = 0x00ffff;
}

I was studying Data Structure book last week and have converted some C based sorting Algorithms into AS3. The code is quite slow as compared to Flash Player’s internal sorting algorithms however just for an example purpose i have written this code

Following are 3 algorithms those i have converted. All these 3 are not one of the fastest however Fastest ones are in queue and will be up soon

Bubble Sort : Exchange two adjacent elements if they are out of order. Repeat until array is sorted. This is a slow algorithm.
Selection Sort : Find the largest element in the array, and put it in the proper place. Repeat until array is sorted. This is also slow.
Insertion Sort : Scan successive elements for out of order item, then insert the item in the proper place. Sort small array fast, big array very slowly.

Following is code for Bubble sort and rest you can download from here

Read the rest of this entry »

The AIR SDK provides the following command-line tools:

AMXMLC : AMXMLC is a simple wrapper for the MXMLC Flex compiler, which links in the appropriate AIR-specific libraries.

Usage is the same as it is in flex compiler MXMLC:

amxmlc main.mxml

This shell script is included in the bin directory of the AIR SDK directory.

The first argument passed to the compiler is the location of the MXML file to compile (main.mxml in the previous example).

There are a number of other options for the MXMLC compiler which you can find in SDK Help. Read the rest of this entry »

Rich Internet applications (RIAs) are web applications that have the features and functionality of traditional desktop applications. RIAs typically transfer the processing necessary for the user interface to the web client but keep the bulk of the data (i.e. the state of the program, the data, etc.) back on the application server.

RIAs typically do the following:

  • run in a web browser, or do not require software installation
  • run locally in a secure environment called a sandbox

A number of platforms on the market enable developers to create RIA applications, including the perennial favorite, Adobe Flash. Some of the top RIA platforms available today are: Read the rest of this entry »

This is an exciting feature when you are developing an application for AIR platform. The feature supports AIR application to store encrypted data onto local hard disk. The encryption used is of 128 bit. Here is more information on the class.

The EncryptedLocalStore class provides methods for setting and getting objects in the encrypted local data store for an AIR application. A persistent encrypted local store is available for each AIR application installed on a user’s computer. This lets you save and retrieve data that is stored on the user’s local hard drive in an encrypted format that cannot be deciphered by other applications or users. A separate encrypted local store is used for each AIR application, and each AIR application uses a separate encrypted local store for each user.

You may want to use the encrypted local store to store information that must be secured, such as login credentials for web services.

When testing an application in the AIR Debug Launcher (ADL), the application uses a different encrypted local store than is used by the installed AIR application.

AIR uses DPAPI on Windows® and KeyChain on Mac® OS® to associate the encrypted local store to each application and user. The encrypted local store uses AES-CBC 128-bit encryption.

Information in the encrypted local store is available only to AIR application content in the application security sandbox. Read the rest of this entry »

A copule of days back i have come across a situation where we need to escape multiple xml files, so just to explore AIR and have a conversion utility i have created this small application using flash.filesystem package of AIR. The utitlity provide an option to browse a text/xml (UTF/ANSI) file on disk and then escape the textual information and provide the same. You can save the escaped string as a file.

Escape string utility

Escape string utility

You can download the installable version from here

Get source code from here

The application is an experiment based on Adobe Air and newly introduced Binary Socket class in Actionscript 3. The support for XMLSocket was there in earlier version AS1 and AS2 however now with AS3 developers have another socket class i.e Binary socket. So to try it out i have thought to write a socket tester to check what all ports on my local machine are open. I am attaching the source here as well, so you can go thorough it.

Adobe AIR port Tester application

Things to remember is that if you want to test any external IP or server then you need to load the crossdomain policy file for that. I have commented that code in my source. This is a rough cut of the same so you can extend it to test the ports and find out what type of port is open etc.

Read the rest of this entry »


May 2024
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Blog Stats

  • 326,382 hits