The Robot Desktop Companion

This AIR widget is a fun animated companion who will entertain you with trivia, quotes and positive compliments. The robot desktop companion will also tell you the current weather in Toronto at the click of a button. To personalize the robot desktop companion, you can easily enter your own comments, trivia, and quotes which the robot will display. Furthermore, the robot companion can be dragged to anywhere on your desktop.

Below is a screenshot of the Robot Desktop Companion:

The robot can be dragged around the desktop by a mouse down. The robot will display a new comment every 10 seconds. Sometimes it moves and grows, occasionally it dances. By clicking the "add expression" button, the user can enter any text they choose by typing into the textfield that pops up. Clicking on the weather button displays the current weather in Toronto, provided via an RSS feed. Similarly, clicking on the quotes button causes the robot to display a quote of the day, also from an RSS feed.

The application writes an XML file to the user's documents directory. This is where all the robot's sayings/expressions are stored. When the user enters a new expression, it gets added to the XML file and the robot can display those expressions while the application runs and also the next time the application is opened.

The Robot Desktop Companion was developed using the following classes:

1) The flash.net.URLLoader and URL Request Classes which load the XML file included with the application, so that the robot has a few built-in sayings to entertain the user, and offer some insight as to how to use the application. These classes are also used to load the weather and quotes information from an external RSS feed.
2) The flash.filesystem classes which are specific to AIR and are used to read and write XML to the user's documents directory. The advantage of opening files asynchronously is that other code can execute while Adobe AIR runs read and write processes in the background.
3) The flash.text.TextField and TextFieldType classes which are used to create a dynamic text field where the robot's expressions are displayed, as well as an input text field where the user can enter text.
4) The flash.utils.Timer class which is used to set up a timer that fires every 10 seconds and triggers other events such as the robot's dance party, the robot's animation and the changing of the text in the robot's speech bubble.
5) The flash.events classes which provide much of the functionality of the application, there are Mouse Event listeners which trigger events such as dragging the application, closing the application and activating the functions attached to the buttons. There are also close events that call a function when data writing/updating via the fileStream is complete.
6) The flash.media.SoundChannel class is used to control the sound effects of the application.

The Robot Desktop Companion was designed and developed by Anissa Hart in March 2008.