 
 import flash.display.Sprite;
 
+import flash.events.ContextMenuEvent;
 import flash.events.Event;
 import flash.events.IOErrorEvent;
 import flash.events.KeyboardEvent;

        }
    }

    /** Our gigantic text field. */
    protected var _field :TextField;


        _field.setTextFormat(format);
        _field.x = (loaderInfo.width - _field.width) / 2;
        _field.y = (loaderInfo.height - _field.height) / 2;

        // get the preferences
        _prefs = SharedObject.getLocal("prefs");

        // add the context menu to change colors
        contextMenu = new ContextMenu();
        contextMenu.hideBuiltInItems();
        contextMenu.customItems = [ ];
        var captions :Array = [ "White", "Green", "Amber" ];
        var colors :Array = [ 0xFFFFFF, 0x00FF00, 0xFFFF00 ];
        var setColor :Function = function (caption :String) :void {
            _prefs.setProperty("color", caption);
            for (var kk :int = 0; kk < captions.length; kk++) {
                if (captions[kk] == caption) {
                    _field.textColor = colors[kk];
                    contextMenu.customItems[kk].enabled = false;
                } else {
                    contextMenu.customItems[kk].enabled = true;
                }
            }
        };
        var updateColor :Function = function (event :ContextMenuEvent) :void {
            setColor(ContextMenuItem(event.target).caption);
        };
        for (var kk :int = 0; kk < captions.length; kk++) {
            var item :ContextMenuItem = new ContextMenuItem(captions[kk]);
            contextMenu.customItems.push(item);
            item.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, updateColor);
        }
        setColor(_prefs.data["color"] == undefined ? "Green" : _prefs.data["color"]);

        // listen for key events
        addEventListener(KeyboardEvent.KEY_DOWN, sendKeyMessage);
