Posts tagged ‘Flex 4’

Resumable File Downloader – Simple AIR app

This AIR application demonstrates how to download, pause and resume downloads of larger files(mp3, flv, etc) and save to the user’s computer. Big Thanks to Benjamin Dobler for his blog post Resumable Downloads with AIR.

Sample Files:
ResumableDownloader.air (AIR, 524 KB)

Sending messages from server socket to client sockets

In this example i want to show you how to send messages from server socket(AIR app) to client sockets(AIR apps). You can install all 3 applications on the same computer or ServerSocketDemo.air on the server(it could be your mac or pc) and SocketDemo.air on any other computer on your local area network(LAN).

NOTE: You will need AIR 2 BETA – Download the Runtime

Files: ServerSocketDemo.air, SocketDemo.air, SocketDemo2.air
Source Codes: ServerSocketDemo.mxml, SocketDemo.mxml

Export Data to Excel File

In this example i want to show you how to write data to Excel file from a Flex application. I use as3xls library and FileReference.save() method in Flash Player 10.

Setting cursor position at the end of a TextInput control

Below code shows you how to set cursor position at the end of a TextInput control in Flex 4.

import mx.events.FlexEvent;

// Flex 4
private function creationComplete(event:FlexEvent):void
{
    textInput.selectRange(textInput.text.length, textInput.text.length);
    textInput.setFocus();
}