6 December 2010
Knowledge of ActionScript 3 and Flex is required to make the most of this article.
Also required
Intermediate
This article describes how to create a custom application for Adobe Connect that saves data locally on the user’s machine. Although Flash Player doesn’t support this functionality by default, it is available when you are using the Adobe Connect Add-in to launch meetings. After reading this article you should be able to write your own application that will save any string to a file on the local machine.
When running the Adobe Connect Add-In you can use the file reference class to download data from a server to the client machine and to upload data to the server from the client machine. The same class exposes a saveText function, which you can use to save text directly to a file if you are running the add-in.
Because this function is not directly available in Flash Player, you need to use it as a dynamic property in order to compile your application with the Flex compiler; for example:
public var fileRef:FileReference = new FileReference();
fileRef['saveText'](textToSave, defaultFileName= null, defaultExtension=null);
This code will open a file save dialog box that prompts for the location and name of the file to save.
The onApply() function in the sample application checks for the availability of this API and then uses it to save text locally:
public function onApply():void
{
if (fileRef.hasOwnProperty('saveText'))
{
try
{
fileRef['saveText']("Adobe Connect Information..." + ta.text);
}
catch(e:Error)
{
trace("Error Message " + e.message);
}
}
}
When the sample application is compiled into an SWF and loaded in Flash Player without the Adobe Connect Add-in, the Button and TextArea are disabled (see Figure 1).

When the sample SWF is loaded in the Adobe Connect Add-in, the Button and TextArea are enabled, and you can use them to save text to the local machine (see Figure 2).

To test the application, type some text and click Save Text. When the file save dialog box opens, simply specify the destination path for the file where the text will be saved.
For more information on extending the functionality of Adobe Connect for end users, see the Adobe Connect Developer Center.