Example: Building A Telnet Client - Adobe FLEX 2-PROGRAMMING ACTIONSCRIPT 3.0 Manual

Programming actionscript 3.0
Table of Contents

Advertisement

{
var request:URLRequest = new URLRequest("http://www.[yourdomain].com/
fileUploadScript.cfm");
var file:FileReference;
var files:FileReferenceList = FileReferenceList(event.target);
var selectedFileArray:Array = files.fileList;
for (var i:uint = 0; i < selectedFileArray.length; i++)
{
file = FileReference(selectedFileArray[i]);
file.addEventListener(Event.COMPLETE, completeHandler);
try
{
file.upload(request);
}
catch (error:Error)
{
trace("Unable to upload files.");
}
}
}
function completeHandler(event:Event):void
{
trace("uploaded");
}
Because the
Event.COMPLETE
array, Flash Player calls the
uploading.

Example: Building a Telnet client

The Telnet example demonstrates techniques for connecting with a remote server and
transmitting data using the Socket class. These techniques the example demonstrates are:
Creating a custom telnet client using the Socket class
Sending text to the remote server using a ByteArray object
Handling received data from a remote server
404
Networking and Communication
event is added to each individual FileReference object in the
completeHandler()
method when each individual file finishes

Advertisement

Table of Contents
loading

This manual is also suitable for:

Flex

Table of Contents