Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 665

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Flex and AIR Integration in ColdFusion
private function browseFiles(event:Event):void
{
filereflist.browse(fileTypes);
}
//
called after user selects files form the browse dialogue box.
private function selectHandler(event:Event):void
{var i:int;
for (i=0;i < event.currentTarget.fileList.length; i ++)
{
fileslist.addItem(event.currentTarget.fileList[i]);
attachList.text +=
}
}
private function uploadFiles(event:Event):void
{
if (fileslist.length > 0)
{
fileRef = FileReference(fileslist.getItemAt(0));
fileRef.addEventListener(Event.COMPLETE, completeHandler);
fileRef.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA,dataHandler);
fileRef.upload(uploadURL);
}
else if (fileslist.length == 0)
{
sendmail();
}
}
// called after a file has been successfully uploaded | We use this as well to check if there
are any files left to upload and how to handle it
private function completeHandler(event:Event):void
{
// Alert.show("File Uploaded successfully");
fileslist.removeItemAt(0);
if (fileslist.length > 0)
{
uploadFiles(null);
}
}
//called after file upload is done and Data has been returned from Server
private function dataHandler(event:DataEvent):void
{
attachCollection[urlcnt++] = {"file":
Util.extractURLFromUploadResponse(event.data.toString())};
if (fileslist.length == 0)
sendmail();
}
private function sendmail():void
{
mailtest.execute();
}
public function handleResult(event:ColdFusionServiceResultEvent):void
{
from.text="";too.text=""; cc.text="";bcc.text="";
subject.text="";mailbody.text="";
attachList.text=""; fileslist.removeAll();
event.currentTarget.fileList[i].name + ",
Last updated 1/20/2012
660
";

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents