Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 4896 lines (4346 sloc) 218 KB
package {
import flash.display.MovieClip;
import flash.net.*;
import flash.events.*;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.display.Sprite;
import flash.display.DisplayObject;
import fl.controls.TextArea;
import fl.controls.Button;
import fl.controls.RadioButton;
import fl.controls.RadioButtonGroup;
import fl.controls.ComboBox;
import fl.controls.CheckBox;
import net.eriksjodin.arduino.Arduino;
import net.eriksjodin.arduino.events.ArduinoEvent;
import flash.display.Sprite;
import flash.display.Loader;
import fl.video.FLVPlayback;
import fl.video.MetadataEvent;
import fl.video.CuePointType;
import fl.video.IVPEvent;
import fl.video.VideoEvent;
import flash.display.*;
import flash.events.TimerEvent;
import flash.utils.*;
import flash.system.fscommand;
import flash.ui.Mouse;
import flash.media.Sound;
import flash.text.Font;
import flash.text.TextField;
import flash.text.TextFieldAutoSize;
import flash.text.AntiAliasType;
import flash.text.TextFormat;
import flash.text.*;
import flash.errors.*;
import flash.events.ErrorEvent;
import flash.errors.IOError;
import flash.events.IOErrorEvent;
import flash.events.ProgressEvent;
import flash.net.Socket;
import flash.utils.ByteArray;
import flash.filesystem.*;
import flash.filesystem.File;
import flash.filesystem.FileStream;
import flash.filesystem.FileMode;
import flash.events.InvokeEvent;
import flash.desktop.NativeApplication;
import flash.system.Capabilities;
import flash.net.URLRequest;
import flash.net.URLVariables;
import flash.events.NetStatusEvent;
import flash.events.HTTPStatusEvent;
import flash.display.Sprite;
import flash.events.MouseEvent;
import flash.events.NetStatusEvent;
import flash.events.HTTPStatusEvent;
import flash.net.*;
import com.yahoo.astra.fl.managers.AlertManager;
import com.swfjunkie.tweetr.Tweetr;
import com.swfjunkie.tweetr.oauth.OAuth;
import com.swfjunkie.tweetr.oauth.events.OAuthEvent;
import flash.display.Sprite;
import flash.geom.Rectangle;
import flash.html.HTMLLoader;
import fl.controls.Slider;
import fl.events.SliderEvent;
import fl.controls.Label;
import flash.display.NativeMenu;
import flash.display.NativeMenuItem;
import flash.display.NativeWindow;
public class basic_config extends MovieClip {
private var xmlLoader:URLLoader;
private var foundArduino:int=0;
private var SerproxyRunning:int=0;
private var com_port;
private var aa:Arduino;
private var bb:Arduino;
private var cc:Arduino;
private var dd:Arduino;
private var ee:Arduino;
private var ff:Arduino;
private var gg:Arduino;
private var hh:Arduino;
private var ii:Arduino;
private var noArduinoFoundTimer:Timer;
private var myTimer:Timer = new Timer(3000, 1);
private var myTimer2:Timer = new Timer(3000, 1);
private var SerproxyCheckTimer:Timer;
private var myFont:Font = new MyriadFont(); //used for stock text
private var admin_flag:int = 0;
private var index_selected:int;
private var stock_counter:int=0; //the total number of stocks
private var first_stock:int=0;
private var temp_stock_array:Array = new Array(); //used as a temp holder for the stocks
private var weather_code;
private var weather_high:int;
private var good_weather_threshold:int;
private var myXML:XML = new XML();
private var myXMLold:XML = new XML();
private var file:File = new File();
private var file2:File = new File();
private var file3:File = new File();
private var PhotoSaveDir:File = new File();
private var photoboothOverlayImagePath:File = new File();
private var photoboothLogoPath:File = new File();
private var filestream:FileStream = new FileStream();
private var AlertTextFormat:TextFormat = new TextFormat();
private var StartupTextFormat:TextFormat = new TextFormat(); //this is the formatter for the startup text field
private var StartupText:TextField = new TextField;
private var ArduinoFound:TextArea = new TextArea;
private var tweetr:Tweetr;
private var oauth:OAuth;
private var htmlLoader:HTMLLoader;
private var radiotext:TextFormat = new TextFormat();
private var radiotext2:TextFormat = new TextFormat();
private var switch5_radio_on:RadioButton = new RadioButton;
private var switch5_radio_off:RadioButton = new RadioButton;
private var switch5_rgb:RadioButtonGroup = new RadioButtonGroup("switch5_rgb");
private var switch4_radio_on:RadioButton = new RadioButton;
private var switch4_radio_off:RadioButton = new RadioButton;
private var switch4_rgb:RadioButtonGroup = new RadioButtonGroup("switch4_rgb");
private var analog1_radio_on:RadioButton = new RadioButton;
private var analog1_radio_off:RadioButton = new RadioButton;
private var analog1_rgb:RadioButtonGroup = new RadioButtonGroup("analog1_rgb");
private var analog2_radio_on:RadioButton = new RadioButton;
private var analog2_radio_off:RadioButton = new RadioButton;
private var analog2_rgb:RadioButtonGroup = new RadioButtonGroup("analog2_rgb");
private var analog3_radio_on:RadioButton = new RadioButton;
private var analog3_radio_off:RadioButton = new RadioButton;
private var analog3_rgb:RadioButtonGroup = new RadioButtonGroup("analog3_rgb");
private var twitter_rbg:RadioButtonGroup = new RadioButtonGroup("twitter_rbg");
private var twitter_mode_rbg:RadioButtonGroup = new RadioButtonGroup("twitter_mode_rbg");
private var TTS_rbg:RadioButtonGroup = new RadioButtonGroup("TTS_rbg");
private var TTS_languages_dropdown:ComboBox = new ComboBox(); //dropdown
private var tts_feature_radio_on:RadioButton = new RadioButton;
private var tts_feature_radio_off:RadioButton = new RadioButton;
private var photobooth_printing_radio_on:RadioButton = new RadioButton;
private var photobooth_printing_radio_off:RadioButton = new RadioButton;
private var twitter_mode_radio_user:RadioButton = new RadioButton;
private var twitter_mode_radio_search:RadioButton = new RadioButton;
private var twitter_mode_radio_mentions:RadioButton = new RadioButton;
private var tts_url:TextField = new TextField();
//private var TTS_languages_dropdown:ComboBox = new ComboBox(); //dropdown
private var proximity1_tts:TextField = new TextField();
private var proximity2_tts:TextField = new TextField();
private var proximity3_tts:TextField = new TextField();
private var weather_good_tts:TextField = new TextField();
private var weather_ok_tts:TextField = new TextField();
private var weather_rain_tts:TextField = new TextField();
private var no_internet_tts:TextField = new TextField();
private var stock_up_tts:TextField = new TextField();
private var stock_no_change_tts:TextField = new TextField();
private var stock_down_tts:TextField = new TextField();
private var doorbell_tts:TextField = new TextField();
private var x10_on_tts:TextField = new TextField();
private var x10_off_tts:TextField = new TextField();
private var drink1_tts:TextField = new TextField();
private var drink2_tts:TextField = new TextField();
private var drink3_tts:TextField = new TextField();
private var drink4_tts:TextField = new TextField();
private var blow_tts:TextField = new TextField();
private var wait_tts:TextField = new TextField();
private var warning_tts:TextField = new TextField();
private var TTSTextFormat:TextFormat = new TextFormat;
private var photoboothTextLabelFormat:TextFormat = new TextFormat;
private var photobooth_Screen_Label:TextField = new TextField();
private var photobooth_Screen_LabelFormat:TextFormat = new TextFormat;
private var tts_feature_label:TextField = new TextField(); //radio button
private var tts_url_label:TextField = new TextField();
private var tts_language_label:TextField = new TextField(); //drop down
//private var tts_engine_label:TextField = new TextField();
private var proximity1_tts_label:TextField = new TextField();
private var proximity2_tts_label:TextField = new TextField();
private var proximity3_tts_label:TextField = new TextField();
private var weather_good_tts_label:TextField = new TextField();
private var weather_ok_tts_label:TextField = new TextField();
private var weather_rain_tts_label:TextField = new TextField();
private var no_internet_tts_label:TextField = new TextField();
private var stock_up_tts_label:TextField = new TextField();
private var stock_no_change_tts_label:TextField = new TextField();
private var stock_down_tts_label:TextField = new TextField();
private var doorbell_tts_label:TextField = new TextField();
private var x10_on_tts_label:TextField = new TextField();
private var x10_off_tts_label:TextField = new TextField();
private var drink1_tts_label:TextField = new TextField();
private var drink2_tts_label:TextField = new TextField();
private var drink3_tts_label:TextField = new TextField();
private var drink4_tts_label:TextField = new TextField();
private var tts_instructions:TextField = new TextField;
private var blow_tts_label:TextField = new TextField();
private var wait_tts_label:TextField = new TextField();
private var warning_tts_label:TextField = new TextField();
private var TTSTextLabelFormat:TextFormat = new TextFormat;
private var tts_api_key:TextField = new TextField();
private var tts_api_key_label:TextField = new TextField();
private var tts_api_keyYakitome:TextField = new TextField();
private var tts_api_key_labelYakitome:TextField = new TextField();
private var only_my_tweets_checkbox:CheckBox = new CheckBox();
private var do_not_speak_twitter_search_term_checkbox:CheckBox = new CheckBox();
private var tweetBreathalyzer_checkbox:CheckBox = new CheckBox();
private var StandAloneCheck:CheckBox = new CheckBox();
private var TTS_Screen_Label:TextField = new TextField();
private var TTS_Screen_LabelFormat:TextFormat = new TextFormat;
private var black_square:Sprite = new Sprite();
private var onoff_house_code_input:ComboBox = new ComboBox();
private var onoff_unit_code_input:ComboBox = new ComboBox();
private var photobooth_printing_check:CheckBox = new CheckBox();
private var photobooth_promptprint_check:CheckBox = new CheckBox();
private var photobooth_save_check:CheckBox = new CheckBox();
private var photobooth_x10_check:CheckBox = new CheckBox();
private var photobooth_leds_check:CheckBox = new CheckBox();
private var photobooth_kinect_check:CheckBox = new CheckBox();
private var photoboothProofPreview_check:CheckBox = new CheckBox();
private var photoboothFacialRecognitionTrigger_check:CheckBox = new CheckBox();
private var photobooth_PaperSize_dropdown:ComboBox = new ComboBox();
private var photobooth_PrintCopies_label:Label = new Label();
private var photobooth_PrintCopiesValue_label:Label = new Label();
private var photobooth_SaveFolder_label:Label = new Label();
private var photobooth_SaveFolderPath_label:Label = new Label();
private var photobooth_x10HouseCode_label:Label = new Label();
private var photobooth_x10UnitCode_label:Label = new Label();
private var photobooth_WebcamResolution_label:Label = new Label();
private var photobooth_WebcamResolution_dropdown:ComboBox = new ComboBox(); //webcam resolution dropdown
private var photobooth_WebcamFPS_label:Label = new Label();
private var photobooth_CountDownFrom_label:Label = new Label();
private var photobooth_ShotDelay_label:Label = new Label();
private var photobooth_PhotoPreviewDuration_label:Label = new Label();
private var photobooth_ProofPreviewDuration_label:Label = new Label();
private var photobooth_WebcamFPSValue_label:Label = new Label();
private var photobooth_CountDownFromValue_label:Label = new Label();
private var photobooth_ShotDelayValue_label:Label = new Label();
private var photobooth_PhotoPreviewDurationValue_label:Label = new Label();
private var photobooth_ProofPreviewDurationValue_label:Label = new Label();
private var photobooth_PrintingInfo_label:Label = new Label();
private var photobooth_BackgroundImage_label:Label = new Label();
private var photobooth_BackgroundImagePath_label:Label = new Label();
private var photobooth_BackgroundImage_check:CheckBox = new CheckBox();
private var photobooth_StartupText_label:Label = new Label();
private var photobooth_PaperSize_label:Label = new Label();
private var photobooth_StartupText_textarea:TextField = new TextField();
private var photobooth_LogoImage_label:Label = new Label();
private var photobooth_LogoImagePath_label:Label = new Label();
private var photobooth_LogoImage_check:CheckBox = new CheckBox();
private var photobooth_PrintCopies_slider:Slider = new Slider();
private var photobooth_WebcamFPS_slider:Slider = new Slider();
private var photobooth_CountDownFrom_slider:Slider = new Slider();
private var photobooth_ShotDelay_slider:Slider = new Slider();
private var photobooth_PhotoPreviewDuration_slider:Slider = new Slider();
private var photobooth_ProofPreviewDuration_slider:Slider = new Slider();
private var photobooth_videoQuality:Slider = new Slider();
private var photobooth_videoQuality_sliderlabel:Label = new Label();
private var photobooth_videoWidth:TextField = new TextField();
private var photobooth_videoHeight:TextField = new TextField();
private var photobooth_fps:TextField = new TextField();
private var photobooth_countdown:TextField = new TextField();
private var photobooth_print_copies:TextField = new TextField();
private var photoboothShotDelay:TextField = new TextField();
private var photoboothGalleryTimer:TextField = new TextField();
private var photoboothProofDisplayTime:TextField = new TextField();
private var photobooth_videoQuality_label:TextField = new TextField();
private var photobooth_videoWidth_label:TextField = new TextField();
private var photobooth_videoHeight_label:TextField = new TextField();
private var photobooth_fps_label:TextField = new TextField();
private var photobooth_countdown_label:TextField = new TextField();
private var photobooth_print_copies_label:TextField = new TextField();
private var photoboothShotDelay_label:TextField = new TextField();
private var photoboothGalleryTimer_label:TextField = new TextField();
private var photoboothProofDisplayTime_label:TextField = new TextField();
private var photobooth_printing_rbg:RadioButtonGroup = new RadioButtonGroup("photobooth_printing_rbg");
private var SaveButton:Button = new Button();
private var goBackMain:Button = new Button();
private var twitterAuthButton:Button = new Button();
private var tts_engine_voicerss:RadioButton = new RadioButton;
private var tts_engine_yakitome:RadioButton = new RadioButton;
private var flashPlayerVersion:String = Capabilities.version;
private var osArray:Array = flashPlayerVersion.split(' ');
private var osType:String = osArray[0]; //The operating system: WIN, MAC, LNX
private var versionArray:Array = osArray[1].split(',');//The player versions. 9,0,115,0
private var majorVersion:Number = parseInt(versionArray[0]);
private var majorRevision:Number = parseInt(versionArray[1]);
private var minorVersion:Number = parseInt(versionArray[2]);
private var fileMenu:NativeMenuItem;
private var TTS_rbg_engine:RadioButtonGroup = new RadioButtonGroup("TTS_rbg_engine");
public function basic_config():void {
//stage.align = StageAlign.TOP_LEFT;
//stage.scaleMode = StageScaleMode.NO_BORDER;
//var window:NativeWindow = stage.nativeWindow;
//window.maximize();
AlertTextFormat.color = 0x000000; //black
AlertTextFormat.font = myFont.fontName;
AlertTextFormat.size = 30; //70 default
AlertManager.overlayAlpha = .8;
AlertManager.maxWidth = 800;
AlertManager.hasDropShadow = true;
AlertManager.setMessageBoxStyle("textFormat", AlertTextFormat);
//output.visible = false;
file = File.documentsDirectory;
file = file.resolvePath("diymagicmirror-settings/mirrorconfig.xml"); //now see if the config file is there
if (file.exists == false) { //config file not there so create it
CreateConfig();
}
switch (osType) {
case "MAC":
file2 = File.desktopDirectory;
file2 = file2.resolvePath("../../../Applications/DIY Magic Mirror/mirror.app/Contents/Resources/");
break;
case "WIN":
file3 = file3 = File.desktopDirectory;
file3 = file3.resolvePath("../../../Program Files/DIY Magic Mirror/mirror/mirror.exe");
file2 = File.desktopDirectory;
file2 = file2.resolvePath("../../../Program Files/DIY Magic Mirror/mirror/");
if (file3.exists == false) { //if still false, then must be 64-bit
file2 = File.desktopDirectory;
file2 = file2.resolvePath("../../../Program Files (x86)/DIY Magic Mirror/mirror/");
}
break;
case "LNX":
file2 = File.desktopDirectory;
file2 = file2.resolvePath("../../../opt/DIY Magic Mirror/mirror/share");
break;
default:
output.text = "Unable to detect OS";
trace ("Unable to detect OS");
file3 = file3 = File.desktopDirectory;
file3 = file3.resolvePath("../../../Program Files/DIY Magic Mirror/mirror/mirror.exe");
file2 = File.desktopDirectory;
file2 = file2.resolvePath("../../../Program Files/DIY Magic Mirror/mirror/");
if (file3.exists == false) { //if still false, then must be 64-bit
file2 = File.desktopDirectory;
file2 = file2.resolvePath("../../../Program Files (x86)/DIY Magic Mirror/mirror/");
}
break;
} //end switch
saveButton.addEventListener(MouseEvent.CLICK, saveValue);
updates_button.addEventListener(MouseEvent.CLICK,updates);
add_stock_button.addEventListener(MouseEvent.CLICK, add_stock);
clear_stock_button.addEventListener(MouseEvent.CLICK, clear_stock);
twitterAuthButton.addEventListener(MouseEvent.CLICK,twitterOauthEvent);
TTSButton.addEventListener(MouseEvent.CLICK, TTSButtonEvent);
LanguageButton.addEventListener(MouseEvent.CLICK, TTSButtonEvent);
photoboothButton.addEventListener(MouseEvent.CLICK, photoboothButtonEvent);
goBackMain.addEventListener(MouseEvent.CLICK, goBackMainScreen);
RunMirror(); //configure the Arduino port and then can do the rest of the config
} // end mirror function *************************************
public function RunMirror():void { //triggered after config file loaded
PhotoSaveDir = File.documentsDirectory; //this is used later for the photobooth path
PhotoSaveDir = PhotoSaveDir.resolvePath("diymagicmirror-settings/Photobooth/Photos");
arduino_detected.text = "Searching...";
radiotext.color = 0x333333;
radiotext.font = "Arial";
radiotext.size = 15;
radiotext2.color = 0xFFFFFF;
radiotext2.font = "Arial";
radiotext2.size = 12;
switch5_radio_on.group = switch5_rgb;
switch5_radio_off.group = switch5_rgb;
switch4_radio_on.group = switch4_rgb;
switch4_radio_off.group = switch4_rgb;
analog1_radio_on.group = analog1_rgb;
analog1_radio_off.group = analog1_rgb;
analog2_radio_on.group = analog2_rgb;
analog2_radio_off.group = analog2_rgb;
analog3_radio_on.group = analog3_rgb;
analog3_radio_off.group = analog3_rgb;
tts_feature_radio_on.group = TTS_rbg;
tts_feature_radio_off.group = TTS_rbg;
photobooth_printing_radio_on.group = photobooth_printing_rbg;
photobooth_printing_radio_off.group = photobooth_printing_rbg;
StartupTextFormat.font = myFont.fontName;
StartupTextFormat.size = 40;
StartupText.autoSize = TextFieldAutoSize.CENTER;
StartupText.embedFonts = true;
StartupText.selectable = false;
StartupTextFormat.color = 0x00CC33; //green
StartupText.antiAliasType = AntiAliasType.ADVANCED;
StartupText.x = 400; //500 default for landscape
StartupText.y = 250; //120 default for landscape
StartupText.defaultTextFormat = StartupTextFormat;
addChild(StartupText);
//StartupText.text = "Looking for the Magic Mirror Sensor Hub...";
//StartupText.visible = true;
//output.text = "Looking for the Magic Mirror Sensor Hub...";
filestream.open(file, FileMode.READ);
myXML = XML(filestream.readUTFBytes(filestream.bytesAvailable));
filestream.close();
CheckConfigVersion();
//trace(myXML);
PopulateValues();
BuildUI();
twitter_mode_rbg.addEventListener(Event.CHANGE, TwitterModeChanged);
photoboothProofPreview_check.addEventListener(Event.CHANGE, photoboothProofPreview_checkChanged);
photobooth_printing_check.addEventListener(Event.CHANGE, photobooth_printing_checkChanged);
aa = new Arduino("127.0.0.1", 5331); //connect to serial proxy server
aa.addEventListener(Event.CONNECT,onSocketConnect);
aa.addEventListener(Event.CLOSE,onSocketClose);
aa.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
bb = new Arduino("127.0.0.1", 5332); //connect to serial proxy server
bb.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
cc = new Arduino("127.0.0.1", 5333); //connect to serial proxy server
cc.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
dd = new Arduino("127.0.0.1", 5334); //connect to serial proxy server
dd.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
ee = new Arduino("127.0.0.1", 5335); //connect to serial proxy server
ee.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
ff = new Arduino("127.0.0.1", 5336); //connect to serial proxy server
ff.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
gg = new Arduino("127.0.0.1", 5337); //connect to serial proxy server
gg.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
hh = new Arduino("127.0.0.1", 5338); //connect to serial proxy server
hh.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
ii = new Arduino("127.0.0.1", 5339); //connect to serial proxy server
ii.addEventListener(ArduinoEvent.FIRMWARE_VERSION, onReceiveFirmwareVersion);
SerproxyCheckTimer = new Timer(3000,1);
SerproxyCheckTimer.addEventListener(TimerEvent.TIMER_COMPLETE, noSerproxyEvent);
SerproxyCheckTimer.start();
noArduinoFoundTimer = new Timer(10000,1);
noArduinoFoundTimer.addEventListener(TimerEvent.TIMER_COMPLETE, noArduinoFoundTimerEvent);
noArduinoFoundTimer.start();
TTS_rbg_engine.addEventListener(Event.CHANGE, TTSEngineChanged);
} // ********end RunMirror initMediaPlayer function ***********
private function setupComboBox():void { //setup the combo boxes
onoff_house_code_input.addItem( { label: "A", data:1 } );
onoff_house_code_input.addItem( { label: "B", data:2 } );
onoff_house_code_input.addItem( { label: "C", data:3 } );
onoff_house_code_input.addItem( { label: "D", data:4 } );
onoff_house_code_input.addItem( { label: "E", data:5 } );
onoff_house_code_input.addItem( { label: "F", data:6 } );
onoff_house_code_input.addItem( { label: "G", data:7 } );
onoff_house_code_input.addItem( { label: "H", data:8 } );
onoff_house_code_input.addItem( { label: "I", data:9 } );
onoff_house_code_input.addItem( { label: "J", data:10 } );
onoff_house_code_input.addItem( { label: "K", data:11 } );
onoff_house_code_input.addItem( { label: "L", data:12 } );
onoff_house_code_input.addItem( { label: "M", data:13 } );
onoff_house_code_input.addItem( { label: "N", data:14 } );
onoff_house_code_input.addItem( { label: "O", data:15 } );
onoff_house_code_input.addItem( { label: "P", data:16 } );
onoff_unit_code_input.addItem( { label: "1", data:1 } );
onoff_unit_code_input.addItem( { label: "2", data:2 } );
onoff_unit_code_input.addItem( { label: "3", data:3 } );
onoff_unit_code_input.addItem( { label: "4", data:4 } );
onoff_unit_code_input.addItem( { label: "5", data:5 } );
onoff_unit_code_input.addItem( { label: "6", data:6 } );
onoff_unit_code_input.addItem( { label: "7", data:7 } );
onoff_unit_code_input.addItem( { label: "8", data:8 } );
onoff_unit_code_input.addItem( { label: "9", data:9 } );
onoff_unit_code_input.addItem( { label: "10", data:10 } );
onoff_unit_code_input.addItem( { label: "11", data:11 } );
onoff_unit_code_input.addItem( { label: "12", data:12 } );
onoff_unit_code_input.addItem( { label: "13", data:13 } );
onoff_unit_code_input.addItem( { label: "14", data:14 } );
onoff_unit_code_input.addItem( { label: "15", data:15 } );
onoff_unit_code_input.addItem( { label: "16", data:16 } );
photobooth_WebcamResolution_dropdown.addItem( { label: "160", data:0 } );
photobooth_WebcamResolution_dropdown.addItem( { label: "320", data:1 } );
photobooth_WebcamResolution_dropdown.addItem( { label: "480", data:2 } );
photobooth_WebcamResolution_dropdown.addItem( { label: "640", data:3 } );
photobooth_WebcamResolution_dropdown.addItem( { label: "720 HD", data:4 } );
photobooth_WebcamResolution_dropdown.addItem( { label: "1080 HD", data:5 } );
photobooth_PaperSize_dropdown.addItem( { label: "Photo Size 4 x 6", data:0 } );
photobooth_PaperSize_dropdown.addItem( { label: "Letter 8.5 x 11", data:1 } );
/* old Google TTS languages
TTS_languages_dropdown.addItem( { label: "English", data:"en" } );
TTS_languages_dropdown.addItem( { label: "Spanish", data:"es" } );
TTS_languages_dropdown.addItem( { label: "German", data:"de" } );
TTS_languages_dropdown.addItem( { label: "French", data:"fr" } );
TTS_languages_dropdown.addItem( { label: "Italian", data:"it" } );
TTS_languages_dropdown.addItem( { label: "Hindi", data:"hi" } );
TTS_languages_dropdown.addItem( { label: "Afrikaans", data:"af" } );
TTS_languages_dropdown.addItem( { label: "Czech", data:"cs" } );
TTS_languages_dropdown.addItem( { label: "Croatian", data:"hr" } );
TTS_languages_dropdown.addItem( { label: "Dutch", data:"nl" } );
TTS_languages_dropdown.addItem( { label: "Dannish", data:"da" } );
TTS_languages_dropdown.addItem( { label: "Finnish", data:"fi" } );
TTS_languages_dropdown.addItem( { label: "Greek", data:"el" } );
TTS_languages_dropdown.addItem( { label: "Hatian Creole", data:"ht" } );
TTS_languages_dropdown.addItem( { label: "Hungarian", data:"hu" } );
TTS_languages_dropdown.addItem( { label: "Indonesian", data:"id" } );
TTS_languages_dropdown.addItem( { label: "Islandic", data:"is" } );
TTS_languages_dropdown.addItem( { label: "Latvian", data:"lv" } );
TTS_languages_dropdown.addItem( { label: "Macedonian", data:"mk" } );
TTS_languages_dropdown.addItem( { label: "Norweigen", data:"no" } );
TTS_languages_dropdown.addItem( { label: "Polish", data:"pl" } );
TTS_languages_dropdown.addItem( { label: "Portugese", data:"pt" } );
TTS_languages_dropdown.addItem( { label: "Romanian", data:"ro" } );
TTS_languages_dropdown.addItem( { label: "Serbian", data:"sr" } );
TTS_languages_dropdown.addItem( { label: "Slovak", data:"sk" } );
TTS_languages_dropdown.addItem( { label: "Russian", data:"ru" } );
TTS_languages_dropdown.addItem( { label: "Swahili", data:"sw" } );
TTS_languages_dropdown.addItem( { label: "Swedish", data:"sv" } );
TTS_languages_dropdown.addItem( { label: "Turkish", data:"tr" } );
TTS_languages_dropdown.addItem( { label: "Vietnamese", data:"vi" } );*/
var ttsEngine:String = myXML.tts_engine;
if (ttsEngine == "voicerss") {
populateVoiceRSSLanguageDropdown(); //put these into a function as we need to call from other places too so it will make maintenance easier if these ever change
trace("went to initial xml population for voicerss");
}
else if (ttsEngine == "yakitome") {
populateYakitomeLanguageDropdown();
trace("went to initial xml population for Y");
}
else {
trace("oops, we couldn't find the default TTS engine to use, let's use voice RSS by default");
populateVoiceRSSLanguageDropdown();
}
}
private function BuildUI():void {
TTSTextFormat.font = myFont.fontName;
TTSTextFormat.size = 14;
TTSTextFormat.color = 0x000000; //black
TTSTextLabelFormat.font = myFont.fontName;
TTSTextLabelFormat.size = 14;
TTSTextLabelFormat.color = 0xFFFFFF; //white
photoboothTextLabelFormat.font = myFont.fontName;
photoboothTextLabelFormat.size = 14;
photoboothTextLabelFormat.color = 0xFFFFFF; //white
photobooth_Screen_LabelFormat.font = myFont.fontName;
photobooth_Screen_LabelFormat.size = 36;
photobooth_Screen_LabelFormat.color = 0xFFFFFF; //white
TTS_Screen_LabelFormat.font = myFont.fontName;
TTS_Screen_LabelFormat.size = 20;
TTS_Screen_LabelFormat.color = 0xFFFFFF; //white
SaveButton.x = 470.45;
//SaveButton.y = 610;
SaveButton.y = 610;
SaveButton.width = 133.95;
SaveButton.height = 36.10;
SaveButton.label = "Save";
addChild(SaveButton);
SaveButton.visible = false;
only_my_tweets_checkbox.x = 566.35;
only_my_tweets_checkbox.y = 178.35;
only_my_tweets_checkbox.width = 204.15;
only_my_tweets_checkbox.height = 22;
only_my_tweets_checkbox.label = "Just My Tweets";
addChild(only_my_tweets_checkbox);
//only_my_tweets_checkbox.visible = true;
only_my_tweets_checkbox.visible = false;
do_not_speak_twitter_search_term_checkbox.x = 647.40;
do_not_speak_twitter_search_term_checkbox.y = 201.91;
do_not_speak_twitter_search_term_checkbox.width = 179.15;
do_not_speak_twitter_search_term_checkbox.height = 22;
do_not_speak_twitter_search_term_checkbox.label = "Don't Speak Search Term";
addChild(do_not_speak_twitter_search_term_checkbox);
do_not_speak_twitter_search_term_checkbox.visible = true;
//do_not_speak_twitter_search_term_checkbox.visible = false;
tweetBreathalyzer_checkbox.x = 439.90;
tweetBreathalyzer_checkbox.y = 258.35;
tweetBreathalyzer_checkbox.width = 186.85;
tweetBreathalyzer_checkbox.height = 22;
tweetBreathalyzer_checkbox.label = "Tweet My Breathalyzer Results";
addChild(tweetBreathalyzer_checkbox);
tweetBreathalyzer_checkbox.visible = true;
//tweetBreathalyzer_checkbox.visible = false;
StandAloneCheck.x = 428.90;
StandAloneCheck.y = 303;
StandAloneCheck.width = 590.05;
StandAloneCheck.height = 22;
StandAloneCheck.label = "Stand Alone Mode (For using Twitter feature without Magic Mirror hardware)";
//StandAloneCheck.label = "Stand Alone Mode (For using without Sensor Hub/Arduino Hardware)";
addChild(StandAloneCheck);
StandAloneCheck.visible = true;
SaveButton.addEventListener(MouseEvent.CLICK, saveValue); //this is the save button in the TTS screen
goBackMain.x = 680;
goBackMain.y = 4.85;
goBackMain.width = 99.90;
goBackMain.height = 22;
goBackMain.label = "Go Back";
addChild(goBackMain);
goBackMain.visible = false;
twitterAuthButton.x = 439.65;
twitterAuthButton.y = 148.85;
twitterAuthButton.width = 139.80;
twitterAuthButton.height = 22;
twitterAuthButton.label = "Link Twitter Account";
addChild(twitterAuthButton);
twitterAuthButton.visible = true;
//twitterAuthButton.visible = false;
twitter_mode_radio_user.group = twitter_mode_rbg;
twitter_mode_radio_search.group = twitter_mode_rbg;
twitter_mode_radio_mentions.group = twitter_mode_rbg;
twitter_mode_radio_user.x = 439.90;
twitter_mode_radio_user.y = 179.35;
twitter_mode_radio_user.label = "";
twitter_mode_radio_search.x = 439.90;
twitter_mode_radio_search.y = 203;
twitter_mode_radio_search.label = "";
twitter_mode_radio_mentions.x = 439.90;
twitter_mode_radio_mentions.y = 230.25;
twitter_mode_radio_mentions.label = "";
addChild (twitter_mode_radio_user);
addChild (twitter_mode_radio_search);
addChild (twitter_mode_radio_mentions);
twitter_mode_radio_user.visible = true;
twitter_mode_radio_search.visible = true;
twitter_mode_radio_mentions.visible = true;
tts_feature_radio_on.group = TTS_rbg;
tts_feature_radio_off.group = TTS_rbg;
tts_engine_voicerss.group = TTS_rbg_engine;
tts_engine_yakitome.group = TTS_rbg_engine;
tts_feature_radio_on.x = 250;
tts_feature_radio_on.y = 234.65;
tts_feature_radio_on.setStyle("textFormat", radiotext);
tts_feature_radio_on.textField.autoSize = TextFieldAutoSize.LEFT;
tts_feature_radio_on.label = "ON";
tts_feature_radio_off.x = 330;
tts_feature_radio_off.y = 234.65;
tts_feature_radio_off.setStyle("textFormat", radiotext);
tts_feature_radio_off.textField.autoSize = TextFieldAutoSize.LEFT;
tts_feature_radio_off.label = "OFF";
tts_engine_voicerss.x = 240;
tts_engine_voicerss.y = 35;
tts_engine_voicerss.setStyle("textFormat", radiotext2);
tts_engine_voicerss.textField.autoSize = TextFieldAutoSize.LEFT;
tts_engine_voicerss.label = "VoiceRSS";
tts_engine_yakitome.x = 360;
tts_engine_yakitome.y = 35;
tts_engine_yakitome.setStyle("textFormat", radiotext2);
tts_engine_yakitome.textField.autoSize = TextFieldAutoSize.LEFT;
tts_engine_yakitome.label = "Yakitome (has delay)";
addChild (tts_feature_radio_on);
addChild (tts_feature_radio_off);
tts_feature_radio_on.visible = true;
tts_feature_radio_off.visible = true;
addChild (tts_engine_voicerss);
addChild (tts_engine_yakitome);
tts_engine_voicerss.visible = false;
tts_engine_yakitome.visible = false;
setupComboBox();
TTS_Screen_Label.embedFonts = true;
TTS_Screen_Label.antiAliasType = AntiAliasType.ADVANCED;
TTS_Screen_Label.defaultTextFormat = TTS_Screen_LabelFormat;
TTS_Screen_Label.x = 10;
TTS_Screen_Label.y = 10;
TTS_Screen_Label.width = 400;
TTS_Screen_Label.height = 22;
TTS_Screen_Label.text = "Text to Speech Settings";
addChild(TTS_Screen_Label);
TTS_Screen_Label.visible = false;
tts_feature_label.embedFonts = true;
tts_feature_label.antiAliasType = AntiAliasType.ADVANCED;
tts_feature_label.defaultTextFormat = TTSTextLabelFormat;
tts_feature_label.x = 10;
tts_feature_label.y = 35;
tts_feature_label.width = 180;
tts_feature_label.height = 18;
tts_feature_label.text = "Text to Speech Engine";
addChild(tts_feature_label);
tts_feature_label.visible = false;
tts_url_label.embedFonts = true;
tts_url_label.antiAliasType = AntiAliasType.ADVANCED;
tts_url_label.defaultTextFormat = TTSTextLabelFormat;
tts_url_label.x = 10;
tts_url_label.y = 70;
tts_url_label.width = 200;
tts_url_label.height = 18;
tts_url_label.text = "TTS Web Service URL";
addChild(tts_url_label);
tts_url_label.visible = false;
tts_url.embedFonts = true;
tts_url.selectable = true;
tts_url.type = TextFieldType.INPUT;
tts_url.background = true;
tts_url.backgroundColor = 0xFFFFFF; //white
tts_url.antiAliasType = AntiAliasType.ADVANCED;
tts_url.defaultTextFormat = TTSTextFormat;
tts_url.x = 200;
tts_url.y = 70;
tts_url.width = 600;
tts_url.height = 18;
tts_url.text = myXML.tts_url;
addChild(tts_url);
tts_url.visible = false;
tts_language_label.embedFonts = true;
tts_language_label.antiAliasType = AntiAliasType.ADVANCED;
tts_language_label.defaultTextFormat = TTSTextLabelFormat;
tts_language_label.x = 10;
tts_language_label.y = 60;
tts_language_label.width = 200;
tts_language_label.height = 18;
tts_language_label.text = "TTS/Twitter Language";
addChild(tts_language_label);
tts_language_label.visible = false;
/*tts_engine_label.embedFonts = true;
tts_engine_label.antiAliasType = AntiAliasType.ADVANCED;
tts_engine_label.defaultTextFormat = TTSTextLabelFormat;
tts_engine_label.x = 10;
tts_engine_label.y = 120;
tts_engine_label.width = 100;
tts_engine_label.height = 18;
tts_engine_label.text = "TTS Engine";
addChild(tts_engine_label);
tts_engine_label.visible = false;*/
TTS_languages_dropdown.dropdownWidth = 210;
TTS_languages_dropdown.width = 200;
TTS_languages_dropdown.x = 200;
TTS_languages_dropdown.y = 60;
//TTS_languages_dropdown.prompt = "Select Language";
//TTS_languages_dropdown.addEventListener(Event.CHANGE, changeHandler);
addChild(TTS_languages_dropdown);
TTS_languages_dropdown.visible = false;
tts_api_key_label.embedFonts = true; //to do
tts_api_key_label.antiAliasType = AntiAliasType.ADVANCED;
tts_api_key_label.defaultTextFormat = TTSTextLabelFormat;
tts_api_key_label.x = 10;
tts_api_key_label.y = 100;
tts_api_key_label.width = 200;
tts_api_key_label.height = 18;
tts_api_key_label.text = "Voice RSS API Key";
addChild(tts_api_key_label);
tts_api_key_label.visible = false;
tts_api_key.embedFonts = true;
tts_api_key.selectable = true;
tts_api_key.type = TextFieldType.INPUT;
tts_api_key.background = true;
tts_api_key.backgroundColor = 0xFFFFFF; //white
tts_api_key.maxChars = 100;
tts_api_key.antiAliasType = AntiAliasType.ADVANCED;
tts_api_key.defaultTextFormat = TTSTextFormat;
tts_api_key.x = 200;
tts_api_key.y = 100;
tts_api_key.width = 250;
tts_api_key.height = 18;
tts_api_key.text = myXML.ttsrss_apikey;
addChild(tts_api_key);
tts_api_key.visible = false;
tts_api_key_labelYakitome.embedFonts = true; //to do
tts_api_key_labelYakitome.antiAliasType = AntiAliasType.ADVANCED;
tts_api_key_labelYakitome.defaultTextFormat = TTSTextLabelFormat;
tts_api_key_labelYakitome.x = 480;
tts_api_key_labelYakitome.y = 100;
tts_api_key_labelYakitome.width = 170;
tts_api_key_labelYakitome.height = 18;
tts_api_key_labelYakitome.text = "Yakitome API Key";
addChild(tts_api_key_labelYakitome);
tts_api_key_labelYakitome.visible = false;
tts_api_keyYakitome.embedFonts = true;
tts_api_keyYakitome.selectable = true;
tts_api_keyYakitome.type = TextFieldType.INPUT;
tts_api_keyYakitome.background = true;
tts_api_keyYakitome.backgroundColor = 0xFFFFFF; //white
tts_api_keyYakitome.maxChars = 100;
tts_api_keyYakitome.antiAliasType = AntiAliasType.ADVANCED;
tts_api_keyYakitome.defaultTextFormat = TTSTextFormat;
tts_api_keyYakitome.x = 620;
tts_api_keyYakitome.y = 100;
tts_api_keyYakitome.width = 240;
tts_api_keyYakitome.height = 18;
tts_api_keyYakitome.text = myXML.ttsyakitome_api_key;
addChild(tts_api_keyYakitome);
tts_api_keyYakitome.visible = false;
proximity1_tts_label.embedFonts = true;
proximity1_tts_label.antiAliasType = AntiAliasType.ADVANCED;
proximity1_tts_label.defaultTextFormat = TTSTextLabelFormat;
proximity1_tts_label.x = 10;
proximity1_tts_label.y = 150;
proximity1_tts_label.width = 200;
proximity1_tts_label.height = 18;
proximity1_tts_label.text = "Proximity 1 Response";
addChild(proximity1_tts_label);
proximity1_tts_label.visible = false;
proximity1_tts.embedFonts = true;
proximity1_tts.selectable = true;
proximity1_tts.type = TextFieldType.INPUT;
proximity1_tts.background = true;
proximity1_tts.backgroundColor = 0xFFFFFF; //white
proximity1_tts.maxChars = 100;
proximity1_tts.antiAliasType = AntiAliasType.ADVANCED;
proximity1_tts.defaultTextFormat = TTSTextFormat;
proximity1_tts.x = 200;
proximity1_tts.y = 150;
proximity1_tts.width = 800;
proximity1_tts.height = 18;
proximity1_tts.text = myXML.proximity1_tts;
addChild(proximity1_tts);
proximity1_tts.visible = false;
proximity2_tts_label.embedFonts = true;
proximity2_tts_label.antiAliasType = AntiAliasType.ADVANCED;
proximity2_tts_label.defaultTextFormat = TTSTextLabelFormat;
proximity2_tts_label.x = 10;
proximity2_tts_label.y = 170;
proximity2_tts_label.width = 200;
proximity2_tts_label.height = 18;
proximity2_tts_label.text = "Proximity 2 Response";
addChild(proximity2_tts_label);
proximity2_tts_label.visible = false;
proximity2_tts.embedFonts = true;
proximity2_tts.selectable = true;
proximity2_tts.type = TextFieldType.INPUT;
proximity2_tts.background = true;
proximity2_tts.backgroundColor = 0xFFFFFF; //white
proximity2_tts.maxChars = 100;
proximity2_tts.antiAliasType = AntiAliasType.ADVANCED;
proximity2_tts.defaultTextFormat = TTSTextFormat;
proximity2_tts.x = 200;
proximity2_tts.y = 170;
proximity2_tts.width = 800;
proximity2_tts.height = 18;
proximity2_tts.text = myXML.proximity2_tts;
addChild(proximity2_tts);
proximity2_tts.visible = false;
proximity3_tts_label.embedFonts = true;
proximity3_tts_label.antiAliasType = AntiAliasType.ADVANCED;
proximity3_tts_label.defaultTextFormat = TTSTextLabelFormat;
proximity3_tts_label.x = 10;
proximity3_tts_label.y = 190;
proximity3_tts_label.width = 200;
proximity3_tts_label.height = 18;
proximity3_tts_label.text = "Proximity 3 Response";
addChild(proximity3_tts_label);
proximity3_tts_label.visible = false;
proximity3_tts.embedFonts = true;
proximity3_tts.selectable = true;
proximity3_tts.type = TextFieldType.INPUT;
proximity3_tts.background = true;
proximity3_tts.backgroundColor = 0xFFFFFF; //white
proximity3_tts.maxChars = 100;
proximity3_tts.antiAliasType = AntiAliasType.ADVANCED;
proximity3_tts.defaultTextFormat = TTSTextFormat;
proximity3_tts.x = 200;
proximity3_tts.y = 190;
proximity3_tts.width = 800;
proximity3_tts.height = 18;
proximity3_tts.text = myXML.proximity3_tts;
addChild(proximity3_tts);
proximity3_tts.visible = false;
weather_good_tts_label.embedFonts = true;
weather_good_tts_label.antiAliasType = AntiAliasType.ADVANCED;
weather_good_tts_label.defaultTextFormat = TTSTextLabelFormat;
weather_good_tts_label.x = 10;
weather_good_tts_label.y = 210;
weather_good_tts_label.width = 200;
weather_good_tts_label.height = 18;
weather_good_tts_label.text = "Weather Good Day";
addChild(weather_good_tts_label);
weather_good_tts_label.visible = false;
weather_good_tts.embedFonts = true;
weather_good_tts.selectable = true;
weather_good_tts.type = TextFieldType.INPUT;
weather_good_tts.background = true;
weather_good_tts.backgroundColor = 0xFFFFFF; //white
weather_good_tts.maxChars = 60;
weather_good_tts.antiAliasType = AntiAliasType.ADVANCED;
weather_good_tts.defaultTextFormat = TTSTextFormat;
weather_good_tts.x = 200;
weather_good_tts.y = 210;
weather_good_tts.width = 800;
weather_good_tts.height = 18;
weather_good_tts.text = myXML.weather_good_tts;
addChild(weather_good_tts);
weather_good_tts.visible = false;
weather_ok_tts_label.embedFonts = true;
weather_ok_tts_label.antiAliasType = AntiAliasType.ADVANCED;
weather_ok_tts_label.defaultTextFormat = TTSTextLabelFormat;
weather_ok_tts_label.x = 10;
weather_ok_tts_label.y = 230;
weather_ok_tts_label.width = 200;
weather_ok_tts_label.height = 18;
weather_ok_tts_label.text = "Weather OK Day";
addChild(weather_ok_tts_label);
weather_ok_tts_label.visible = false;
weather_ok_tts.embedFonts = true;
weather_ok_tts.selectable = true;
weather_ok_tts.type = TextFieldType.INPUT;
weather_ok_tts.background = true;
weather_ok_tts.backgroundColor = 0xFFFFFF; //white
weather_ok_tts.maxChars = 60;
weather_ok_tts.antiAliasType = AntiAliasType.ADVANCED;
weather_ok_tts.defaultTextFormat = TTSTextFormat;
weather_ok_tts.x = 200;
weather_ok_tts.y = 230;
weather_ok_tts.width = 800;
weather_ok_tts.height = 18;
weather_ok_tts.text = myXML.weather_ok_tts;
addChild(weather_ok_tts);
weather_ok_tts.visible = false ;
weather_rain_tts_label.embedFonts = true;
weather_rain_tts_label.antiAliasType = AntiAliasType.ADVANCED;
weather_rain_tts_label.defaultTextFormat = TTSTextLabelFormat;
weather_rain_tts_label.x = 10;
weather_rain_tts_label.y = 250;
weather_rain_tts_label.width = 200;
weather_rain_tts_label.height = 18;
weather_rain_tts_label.text = "Weather Raindy Day";
addChild(weather_rain_tts_label);
weather_rain_tts_label.visible = false;
weather_rain_tts.embedFonts = true;
weather_rain_tts.selectable = true;
weather_rain_tts.type = TextFieldType.INPUT;
weather_rain_tts.background = true;
weather_rain_tts.backgroundColor = 0xFFFFFF; //white
weather_rain_tts.maxChars = 60;
weather_rain_tts.antiAliasType = AntiAliasType.ADVANCED;
weather_rain_tts.defaultTextFormat = TTSTextFormat;
weather_rain_tts.x = 200;
weather_rain_tts.y = 250;
weather_rain_tts.width = 800;
weather_rain_tts.height = 18;
weather_rain_tts.text = myXML.weather_rain_tts;
addChild(weather_rain_tts);
weather_rain_tts.visible = false;
no_internet_tts_label.embedFonts = true;
no_internet_tts_label.antiAliasType = AntiAliasType.ADVANCED;
no_internet_tts_label.defaultTextFormat = TTSTextLabelFormat;
no_internet_tts_label.x = 10;
no_internet_tts_label.y = 270;
no_internet_tts_label.width = 200;
no_internet_tts_label.height = 18;
no_internet_tts_label.text = "No Internet";
addChild(no_internet_tts_label);
no_internet_tts_label.visible = false;
no_internet_tts.embedFonts = true;
no_internet_tts.selectable = true;
no_internet_tts.type = TextFieldType.INPUT;
no_internet_tts.background = true;
no_internet_tts.backgroundColor = 0xFFFFFF; //white
no_internet_tts.maxChars = 100;
no_internet_tts.antiAliasType = AntiAliasType.ADVANCED;
no_internet_tts.defaultTextFormat = TTSTextFormat;
no_internet_tts.x = 200;
no_internet_tts.y = 270;
no_internet_tts.width = 800;
no_internet_tts.height = 18;
no_internet_tts.text = myXML.no_internet_tts;
addChild(no_internet_tts);
no_internet_tts.visible = false;
stock_up_tts_label.embedFonts = true;
stock_up_tts_label.antiAliasType = AntiAliasType.ADVANCED;
stock_up_tts_label.defaultTextFormat = TTSTextLabelFormat;
stock_up_tts_label.x = 10;
stock_up_tts_label.y = 290;
stock_up_tts_label.width = 200;
stock_up_tts_label.height = 18;
stock_up_tts_label.text = "Stocks Up";
addChild(stock_up_tts_label);
stock_up_tts_label.visible = false;
stock_up_tts.embedFonts = true;
stock_up_tts.selectable = true;
stock_up_tts.type = TextFieldType.INPUT;
stock_up_tts.background = true;
stock_up_tts.backgroundColor = 0xFFFFFF; //white
stock_up_tts.maxChars = 90;
stock_up_tts.antiAliasType = AntiAliasType.ADVANCED;
stock_up_tts.defaultTextFormat = TTSTextFormat;
stock_up_tts.x = 200;
stock_up_tts.y = 290;
stock_up_tts.width = 800;
stock_up_tts.height = 18;
stock_up_tts.text = myXML.stock_up_tts;
addChild(stock_up_tts);
stock_up_tts.visible = false;
stock_no_change_tts_label.embedFonts = true;
stock_no_change_tts_label.antiAliasType = AntiAliasType.ADVANCED;
stock_no_change_tts_label.defaultTextFormat = TTSTextLabelFormat;
stock_no_change_tts_label.x = 10;
stock_no_change_tts_label.y = 310;
stock_no_change_tts_label.width = 200;
stock_no_change_tts_label.height = 18;
stock_no_change_tts_label.text = "Stocks Little Change";
addChild(stock_no_change_tts_label);
stock_no_change_tts_label.visible = false;
stock_no_change_tts.embedFonts = true;
stock_no_change_tts.selectable = true;
stock_no_change_tts.type = TextFieldType.INPUT;
stock_no_change_tts.background = true;
stock_no_change_tts.backgroundColor = 0xFFFFFF; //white
stock_no_change_tts.maxChars = 90;
stock_no_change_tts.antiAliasType = AntiAliasType.ADVANCED;
stock_no_change_tts.defaultTextFormat = TTSTextFormat;
stock_no_change_tts.x = 200;
stock_no_change_tts.y = 310;
stock_no_change_tts.width = 800;
stock_no_change_tts.height = 18;
stock_no_change_tts.text = myXML.stock_no_change_tts;
addChild(stock_no_change_tts);
stock_no_change_tts.visible = false;
stock_down_tts_label.embedFonts = true;
stock_down_tts_label.antiAliasType = AntiAliasType.ADVANCED;
stock_down_tts_label.defaultTextFormat = TTSTextLabelFormat;
stock_down_tts_label.x = 10;
stock_down_tts_label.y = 330;
stock_down_tts_label.width = 200;
stock_down_tts_label.height = 18;
stock_down_tts_label.text = "Stocks Down";
addChild(stock_down_tts_label);
stock_down_tts_label.visible = false;
stock_down_tts.embedFonts = true;
stock_down_tts.selectable = true;
stock_down_tts.type = TextFieldType.INPUT;
stock_down_tts.background = true;
stock_down_tts.backgroundColor = 0xFFFFFF; //white
stock_down_tts.maxChars = 90;
stock_down_tts.antiAliasType = AntiAliasType.ADVANCED;
stock_down_tts.defaultTextFormat = TTSTextFormat;
stock_down_tts.x = 200;
stock_down_tts.y = 330;
stock_down_tts.width = 800;
stock_down_tts.height = 18;
stock_down_tts.text = myXML.stock_down_tts;
addChild(stock_down_tts);
stock_down_tts.visible = false;
doorbell_tts_label.embedFonts = true;
doorbell_tts_label.antiAliasType = AntiAliasType.ADVANCED;
doorbell_tts_label.defaultTextFormat = TTSTextLabelFormat;
doorbell_tts_label.x = 10;
doorbell_tts_label.y = 350;
doorbell_tts_label.width = 200;
doorbell_tts_label.height = 18;
doorbell_tts_label.text = "Doorbell";
addChild(doorbell_tts_label);
doorbell_tts_label.visible = false;
doorbell_tts.embedFonts = true;
doorbell_tts.selectable = true;
doorbell_tts.type = TextFieldType.INPUT;
doorbell_tts.background = true;
doorbell_tts.backgroundColor = 0xFFFFFF; //white
doorbell_tts.maxChars = 100;
doorbell_tts.antiAliasType = AntiAliasType.ADVANCED;
doorbell_tts.defaultTextFormat = TTSTextFormat;
doorbell_tts.x = 200;
doorbell_tts.y = 350;
doorbell_tts.width = 800;
doorbell_tts.height = 18;
doorbell_tts.text = myXML.doorbell_tts;
addChild(doorbell_tts);
doorbell_tts.visible = false;
x10_on_tts_label.embedFonts = true;
x10_on_tts_label.antiAliasType = AntiAliasType.ADVANCED;
x10_on_tts_label.defaultTextFormat = TTSTextLabelFormat;
x10_on_tts_label.x = 10;
x10_on_tts_label.y = 370;
x10_on_tts_label.width = 200;
x10_on_tts_label.height = 18;
x10_on_tts_label.text = "X-10 ON Command";
addChild(x10_on_tts_label);
x10_on_tts_label.visible = false;
x10_on_tts.embedFonts = true;
x10_on_tts.selectable = true;
x10_on_tts.type = TextFieldType.INPUT;
x10_on_tts.background = true;
x10_on_tts.backgroundColor = 0xFFFFFF; //white
x10_on_tts.maxChars = 100;
x10_on_tts.antiAliasType = AntiAliasType.ADVANCED;
x10_on_tts.defaultTextFormat = TTSTextFormat;
x10_on_tts.x = 200;
x10_on_tts.y = 370;
x10_on_tts.width = 800;
x10_on_tts.height = 18;
x10_on_tts.text = myXML.x10_on_tts;
addChild(x10_on_tts);
x10_on_tts.visible = false;
x10_off_tts_label.embedFonts = true;
x10_off_tts_label.antiAliasType = AntiAliasType.ADVANCED;
x10_off_tts_label.defaultTextFormat = TTSTextLabelFormat;
x10_off_tts_label.x = 10;
x10_off_tts_label.y = 390;
x10_off_tts_label.width = 200;
x10_off_tts_label.height = 18;
x10_off_tts_label.text = "X-10 OFF Command";
addChild(x10_off_tts_label);
x10_off_tts_label.visible = false;
x10_off_tts.embedFonts = true;
x10_off_tts.selectable = true;
x10_off_tts.type = TextFieldType.INPUT;
x10_off_tts.background = true;
x10_off_tts.backgroundColor = 0xFFFFFF; //white
x10_off_tts.maxChars = 100;
x10_off_tts.antiAliasType = AntiAliasType.ADVANCED;
x10_off_tts.defaultTextFormat = TTSTextFormat;
x10_off_tts.x = 200;
x10_off_tts.y = 390;
x10_off_tts.width = 800;
x10_off_tts.height = 18;
x10_off_tts.text = myXML.x10_off_tts;
addChild(x10_off_tts);
x10_off_tts.visible = false;
drink1_tts_label.embedFonts = true;
drink1_tts_label.antiAliasType = AntiAliasType.ADVANCED;
drink1_tts_label.defaultTextFormat = TTSTextLabelFormat;
drink1_tts_label.x = 10;
drink1_tts_label.y = 410;
drink1_tts_label.width = 200;
drink1_tts_label.height = 18;
drink1_tts_label.text = "Breathalyzer No Drinks";
addChild(drink1_tts_label);
drink1_tts_label.visible = false;
drink1_tts.embedFonts = true;
drink1_tts.selectable = true;
drink1_tts.type = TextFieldType.INPUT;
drink1_tts.background = true;
drink1_tts.backgroundColor = 0xFFFFFF; //white
drink1_tts.maxChars = 100;
drink1_tts.antiAliasType = AntiAliasType.ADVANCED;
drink1_tts.defaultTextFormat = TTSTextFormat;
drink1_tts.x = 200;
drink1_tts.y = 410;
drink1_tts.width = 800;
drink1_tts.height = 18;
drink1_tts.text = myXML.drink1_tts;
addChild(drink1_tts);
drink1_tts.visible = false;
drink2_tts_label.embedFonts = true;
drink2_tts_label.antiAliasType = AntiAliasType.ADVANCED;
drink2_tts_label.defaultTextFormat = TTSTextLabelFormat;
drink2_tts_label.x = 10;
drink2_tts_label.y = 430;
drink2_tts_label.width = 200;
drink2_tts_label.height = 18;
drink2_tts_label.text = "Breathalyzer A Few Drinks";
addChild(drink2_tts_label);
drink2_tts_label.visible = false;
drink2_tts.embedFonts = true;
drink2_tts.selectable = true;
drink2_tts.type = TextFieldType.INPUT;
drink2_tts.background = true;
drink2_tts.backgroundColor = 0xFFFFFF; //white
drink2_tts.maxChars = 100;
drink2_tts.antiAliasType = AntiAliasType.ADVANCED;
drink2_tts.defaultTextFormat = TTSTextFormat;
drink2_tts.x = 200;
drink2_tts.y = 430;
drink2_tts.width = 800;
drink2_tts.height = 18;
drink2_tts.text = myXML.drink2_tts;
addChild(drink2_tts);
drink2_tts.visible = false;
drink3_tts_label.embedFonts = true;
drink3_tts_label.antiAliasType = AntiAliasType.ADVANCED;
drink3_tts_label.defaultTextFormat = TTSTextLabelFormat;
drink3_tts_label.x = 10;
drink3_tts_label.y = 450;
drink3_tts_label.width = 200;
drink3_tts_label.height = 18;
drink3_tts_label.text = "Breathalyzer Buzzed";
addChild(drink3_tts_label);
drink3_tts_label.visible = false;
drink3_tts.embedFonts = true;
drink3_tts.selectable = true;
drink3_tts.type = TextFieldType.INPUT;
drink3_tts.background = true;
drink3_tts.backgroundColor = 0xFFFFFF; //white
drink3_tts.maxChars = 100;
drink3_tts.antiAliasType = AntiAliasType.ADVANCED;
drink3_tts.defaultTextFormat = TTSTextFormat;
drink3_tts.x = 200;
drink3_tts.y = 450;
drink3_tts.width = 800;
drink3_tts.height = 18;
drink3_tts.text = myXML.drink3_tts;
addChild(drink3_tts);
drink3_tts.visible = false;
drink4_tts_label.embedFonts = true;
drink4_tts_label.antiAliasType = AntiAliasType.ADVANCED;
drink4_tts_label.defaultTextFormat = TTSTextLabelFormat;
drink4_tts_label.x = 10;
drink4_tts_label.y = 470;
drink4_tts_label.width = 200;
drink4_tts_label.height = 18;
drink4_tts_label.text = "Breathalyzer Drunk";
addChild(drink4_tts_label);
drink4_tts_label.visible = false;
drink4_tts.embedFonts = true;
drink4_tts.selectable = true;
drink4_tts.type = TextFieldType.INPUT;
drink4_tts.background = true;
drink4_tts.backgroundColor = 0xFFFFFF; //white
drink4_tts.maxChars = 100;
drink4_tts.antiAliasType = AntiAliasType.ADVANCED;
drink4_tts.defaultTextFormat = TTSTextFormat;
drink4_tts.x = 200;
drink4_tts.y = 470;
drink4_tts.width = 800;
drink4_tts.height = 18;
drink4_tts.text = myXML.drink4_tts;
addChild(drink4_tts);
drink4_tts.visible = false;
blow_tts_label.embedFonts = true;
blow_tts_label.antiAliasType = AntiAliasType.ADVANCED;
blow_tts_label.defaultTextFormat = TTSTextLabelFormat;
blow_tts_label.x = 10;
blow_tts_label.y = 490;
blow_tts_label.width = 200;
blow_tts_label.height = 18;
blow_tts_label.text = "Breathalyzer Prompt to Blow";
addChild(blow_tts_label);
blow_tts_label.visible = false;
blow_tts.embedFonts = true;
blow_tts.selectable = true;
blow_tts.type = TextFieldType.INPUT;
blow_tts.background = true;
blow_tts.backgroundColor = 0xFFFFFF; //white
blow_tts.maxChars = 60;
blow_tts.antiAliasType = AntiAliasType.ADVANCED;
blow_tts.defaultTextFormat = TTSTextFormat;
blow_tts.x = 200;
blow_tts.y = 490;
blow_tts.width = 800;
blow_tts.height = 18;
blow_tts.text = myXML.blow_tts;
addChild(blow_tts);
blow_tts.visible = false;
wait_tts_label.embedFonts = true;
wait_tts_label.antiAliasType = AntiAliasType.ADVANCED;
wait_tts_label.defaultTextFormat = TTSTextLabelFormat;
wait_tts_label.x = 10;
wait_tts_label.y = 510;
wait_tts_label.width = 200;
wait_tts_label.height = 18;
wait_tts_label.text = "Breathalyzer Prompt to Wait";
addChild(wait_tts_label);
wait_tts_label.visible = false;
wait_tts.embedFonts = true;
wait_tts.selectable = true;
wait_tts.type = TextFieldType.INPUT;
wait_tts.background = true;
wait_tts.backgroundColor = 0xFFFFFF; //white
wait_tts.maxChars = 60;
wait_tts.antiAliasType = AntiAliasType.ADVANCED;
wait_tts.defaultTextFormat = TTSTextFormat;
wait_tts.x = 200;
wait_tts.y = 510;
wait_tts.width = 800;
wait_tts.height = 18;
wait_tts.text = myXML.wait_tts;
addChild(wait_tts);
wait_tts.visible = false;
tts_instructions.embedFonts = true;
tts_instructions.antiAliasType = AntiAliasType.ADVANCED;
tts_instructions.defaultTextFormat = TTSTextLabelFormat;
tts_instructions.autoSize = TextFieldAutoSize.LEFT;
tts_instructions.wordWrap = true;
tts_instructions.x = 10;
tts_instructions.y = 550;
tts_instructions.width = 700;
tts_instructions.height = 40;
tts_instructions.text = "Add the text for the Magic Mirror to speak for the events above. TTS (Text to Speech) can handle a maximum of 100 characters for each event. The Magic Mirror automatically adds text to the end of the Weather and Stock events. To use TTS, run the Magic Mirror and turn the character select knob until you hear 'Custom Audio Mode'.";
addChild(tts_instructions);
tts_instructions.visible = false;
photobooth_Screen_Label.embedFonts = true;
photobooth_Screen_Label.antiAliasType = AntiAliasType.ADVANCED;
photobooth_Screen_Label.defaultTextFormat = photobooth_Screen_LabelFormat;
photobooth_Screen_Label.x = 77.50;
photobooth_Screen_Label.y = 55;
photobooth_Screen_Label.width = 350;
photobooth_Screen_Label.height = 40;
photobooth_Screen_Label.text = "Photobooth Settings";
addChild(photobooth_Screen_Label);
photobooth_Screen_Label.visible = false;
photobooth_printing_check.x = 78;
photobooth_printing_check.y = 127.35;
photobooth_printing_check.width = 130;
photobooth_printing_check.height = 22;
photobooth_printing_check.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_printing_check.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_printing_check.label = "Enable Printing";
addChild(photobooth_printing_check);
photobooth_printing_check.visible = false;
photobooth_PaperSize_dropdown.x = 293.45;
photobooth_PaperSize_dropdown.y = 126.35;
photobooth_PaperSize_dropdown.width = 122;
photobooth_PaperSize_dropdown.height = 22;
photobooth_PaperSize_dropdown.setStyle("textFormat", photoboothTextLabelFormat);
addChild(photobooth_PaperSize_dropdown);
photobooth_PaperSize_dropdown.visible = false;
onoff_house_code_input.x = 416.05;
onoff_house_code_input.y = 242.85;
onoff_house_code_input.width = 48;
onoff_house_code_input.height = 22;
onoff_house_code_input.setStyle("textFormat", photoboothTextLabelFormat);
addChild(onoff_house_code_input);
onoff_house_code_input.visible = false;
onoff_unit_code_input.x = 594.15;
onoff_unit_code_input.y = 242.85;
onoff_unit_code_input.width = 48;
onoff_unit_code_input.height = 22;
onoff_unit_code_input.setStyle("textFormat", photoboothTextLabelFormat);
addChild(onoff_unit_code_input);
onoff_unit_code_input.visible = false;
photobooth_promptprint_check.x = 533.05;
photobooth_promptprint_check.y = 164.45;
photobooth_promptprint_check.width = 208;
photobooth_promptprint_check.height = 22;
photobooth_promptprint_check.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_promptprint_check.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_promptprint_check.label = "Prompt User Before Printing";
addChild(photobooth_promptprint_check);
photobooth_promptprint_check.visible = false;
photobooth_PrintCopies_label.autoSize = TextFieldAutoSize.RIGHT;
photobooth_PrintCopies_label.setStyle("embedFonts", true);
photobooth_PrintCopies_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_PrintCopies_label.text = "Print Copies";
photobooth_PrintCopies_label.x = 141.8;
photobooth_PrintCopies_label.y = 168.45;
photobooth_PrintCopies_label.width = 74.55;
photobooth_PrintCopies_label.height = 18;
//photobooth_PrintCopies_label.move(, 168.45);
addChild(photobooth_PrintCopies_label);
photobooth_PrintCopies_label.visible = false;
photobooth_PrintCopies_slider.x = 242.25;
photobooth_PrintCopies_slider.y = 175.95;
photobooth_PrintCopies_slider.width = 203.90;
photobooth_PrintCopies_slider.height = 3;
photobooth_PrintCopies_slider.maximum = 10;
photobooth_PrintCopies_slider.minimum = 1;
photobooth_PrintCopies_slider.snapInterval = 1;
photobooth_PrintCopies_slider.tickInterval = 1;
photobooth_PrintCopies_slider.value = myXML.photobooth_print_copies;
addChild(photobooth_PrintCopies_slider);
photobooth_PrintCopies_slider.visible = false;
photobooth_PrintCopiesValue_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_PrintCopiesValue_label.setStyle("embedFonts", true);
photobooth_PrintCopiesValue_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_PrintCopiesValue_label.text = myXML.photobooth_print_copies;
photobooth_PrintCopiesValue_label.move(463.85, 168.45);
addChild(photobooth_PrintCopiesValue_label);
photobooth_PrintCopiesValue_label.visible = false;
photobooth_PrintCopies_slider.addEventListener(SliderEvent.THUMB_DRAG, photobooth_PrintCopies_sliderEvent);
photobooth_save_check.x = 78;
photobooth_save_check.y = 200.35;
photobooth_save_check.width = 155;
photobooth_save_check.height = 22;
photobooth_save_check.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_save_check.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_save_check.label = "Save Individual Photos";
addChild(photobooth_save_check);
photobooth_save_check.visible = false;
photobooth_SaveFolder_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_SaveFolder_label.setStyle("embedFonts", true);
photobooth_SaveFolder_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_SaveFolder_label.text = "Save Folder Location:";
photobooth_SaveFolder_label.move(253.75, 202.35);
addChild(photobooth_SaveFolder_label);
photobooth_SaveFolder_label.visible = false;
photobooth_SaveFolderPath_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_SaveFolderPath_label.setStyle("embedFonts", true);
photobooth_SaveFolderPath_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_SaveFolderPath_label.text = String(PhotoSaveDir.nativePath);
//photobooth_SaveFolderPath_label.text = "C:\\Users\\al\\Documents\\diymagicmirror-settings\\photobooth";
photobooth_SaveFolderPath_label.move(431.20, 200.35);
addChild(photobooth_SaveFolderPath_label);
photobooth_SaveFolderPath_label.visible = false;
photobooth_x10_check.x = 78;
photobooth_x10_check.y = 242.25;
photobooth_x10_check.width = 155;
photobooth_x10_check.height = 22;
photobooth_x10_check.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_x10_check.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_x10_check.label = "Enable X-10 Lighting Control";
addChild(photobooth_x10_check);
photobooth_x10_check.visible = false;
photobooth_x10HouseCode_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_x10HouseCode_label.setStyle("embedFonts", true);
photobooth_x10HouseCode_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_x10HouseCode_label.text = "X-10 House Code";
photobooth_x10HouseCode_label.move(298.7, 243.45);
addChild(photobooth_x10HouseCode_label);
photobooth_x10HouseCode_label.visible = false;
photobooth_x10UnitCode_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_x10UnitCode_label.setStyle("embedFonts", true);
photobooth_x10UnitCode_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_x10UnitCode_label.text = "X-10 Unit Code";
photobooth_x10UnitCode_label.move(485.05, 243.45);
addChild(photobooth_x10UnitCode_label);
photobooth_x10UnitCode_label.visible = false;
photobooth_leds_check.x = 682.30;
photobooth_leds_check.y = 243.45;
photobooth_leds_check.width = 155;
photobooth_leds_check.height = 22;
photobooth_leds_check.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_leds_check.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_leds_check.label = "Enable LED Control";
addChild(photobooth_leds_check);
photobooth_leds_check.visible = false;
photobooth_WebcamResolution_label.autoSize = TextFieldAutoSize.RIGHT;
photobooth_WebcamResolution_label.setStyle("embedFonts", true);
photobooth_WebcamResolution_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_WebcamResolution_label.text = "Webcam Resolution";
photobooth_WebcamResolution_label.x = 81.35;
photobooth_WebcamResolution_label.y = 329.35;
photobooth_WebcamResolution_label.width = 135;
photobooth_WebcamResolution_label.height = 18;
addChild(photobooth_WebcamResolution_label);
photobooth_WebcamResolution_label.visible = false;
photobooth_WebcamResolution_dropdown.x = 226.35;
photobooth_WebcamResolution_dropdown.y = 325.35;
photobooth_WebcamResolution_dropdown.width = 122;
photobooth_WebcamResolution_dropdown.height = 22;
photobooth_WebcamResolution_dropdown.setStyle("textFormat", photoboothTextLabelFormat);
addChild(photobooth_WebcamResolution_dropdown);
photobooth_WebcamResolution_dropdown.visible = false;
photobooth_WebcamFPS_label.autoSize = TextFieldAutoSize.RIGHT;
photobooth_WebcamFPS_label.setStyle("embedFonts", true);
photobooth_WebcamFPS_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_WebcamFPS_label.text = "Webcam FPS";
photobooth_WebcamFPS_label.x = 81.35;
photobooth_WebcamFPS_label.y = 368;
photobooth_WebcamFPS_label.width = 135;
photobooth_WebcamFPS_label.height = 18;
addChild(photobooth_WebcamFPS_label);
photobooth_WebcamFPS_label.visible = false;
photobooth_WebcamFPS_slider.x = 242.25;
photobooth_WebcamFPS_slider.y = 375.50;
photobooth_WebcamFPS_slider.width = 203.90;
photobooth_WebcamFPS_slider.height = 3;
photobooth_WebcamFPS_slider.maximum = 30;
photobooth_WebcamFPS_slider.minimum = 5;
photobooth_WebcamFPS_slider.snapInterval = 5;
photobooth_WebcamFPS_slider.tickInterval = 5;
photobooth_WebcamFPS_slider.value = myXML.photobooth_fps;
addChild(photobooth_WebcamFPS_slider);
photobooth_WebcamFPS_slider.visible = false;
photobooth_WebcamFPSValue_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_WebcamFPSValue_label.setStyle("embedFonts", true);
photobooth_WebcamFPSValue_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_WebcamFPSValue_label.text = myXML.photobooth_fps;
photobooth_WebcamFPSValue_label.move(463.85,366);
addChild(photobooth_WebcamFPSValue_label);
photobooth_WebcamFPSValue_label.visible = false;
photobooth_WebcamFPS_slider.addEventListener(SliderEvent.THUMB_DRAG, photobooth_WebcamFPS_sliderEvent);
photobooth_CountDownFrom_label.autoSize = TextFieldAutoSize.RIGHT;
photobooth_CountDownFrom_label.setStyle("embedFonts", true);
photobooth_CountDownFrom_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_CountDownFrom_label.text = "Count Down From";
photobooth_CountDownFrom_label.x = 81.15;
photobooth_CountDownFrom_label.y = 408.4;
photobooth_CountDownFrom_label.width = 135;
photobooth_CountDownFrom_label.height = 18;
addChild(photobooth_CountDownFrom_label);
photobooth_CountDownFrom_label.visible = false;
photobooth_CountDownFrom_slider.x = 245.25;
photobooth_CountDownFrom_slider.y = 415.90;
photobooth_CountDownFrom_slider.width = 203.90;
photobooth_CountDownFrom_slider.height = 3;
photobooth_CountDownFrom_slider.maximum = 10;
photobooth_CountDownFrom_slider.minimum = 3;
photobooth_CountDownFrom_slider.snapInterval = 1;
photobooth_CountDownFrom_slider.tickInterval = 1;
photobooth_CountDownFrom_slider.value = myXML.photobooth_countdown;
addChild(photobooth_CountDownFrom_slider);
photobooth_CountDownFrom_slider.visible = false;
photobooth_CountDownFromValue_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_CountDownFromValue_label.setStyle("embedFonts", true);
photobooth_CountDownFromValue_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_CountDownFromValue_label.text = myXML.photobooth_countdown;
photobooth_CountDownFromValue_label.move(463.85,406.40);
addChild(photobooth_CountDownFromValue_label);
photobooth_CountDownFromValue_label.visible = false;
photobooth_CountDownFrom_slider.addEventListener(SliderEvent.THUMB_DRAG, photobooth_CountDownFrom_sliderEvent);
photobooth_ShotDelay_label.autoSize = TextFieldAutoSize.RIGHT;
photobooth_ShotDelay_label.setStyle("embedFonts", true);
photobooth_ShotDelay_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_ShotDelay_label.text = "Shot Delay (s)";
photobooth_ShotDelay_label.x = 81.15;
photobooth_ShotDelay_label.y = 448.45;
photobooth_ShotDelay_label.width = 135;
photobooth_ShotDelay_label.height = 18;
addChild(photobooth_ShotDelay_label);
photobooth_ShotDelay_label.visible = false;
photobooth_ShotDelay_slider.x = 245.25;
photobooth_ShotDelay_slider.y = 455.95;
photobooth_ShotDelay_slider.width = 203.90;
photobooth_ShotDelay_slider.height = 3;
photobooth_ShotDelay_slider.maximum = 10;
photobooth_ShotDelay_slider.minimum = 1;
photobooth_ShotDelay_slider.snapInterval = 1;
photobooth_ShotDelay_slider.tickInterval = 1;
photobooth_ShotDelay_slider.value = myXML.photoboothShotDelay;
addChild(photobooth_ShotDelay_slider);
photobooth_ShotDelay_slider.visible = false;
photobooth_ShotDelay_slider.addEventListener(SliderEvent.THUMB_DRAG, photobooth_ShotDelay_sliderEvent);
photobooth_ShotDelayValue_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_ShotDelayValue_label.setStyle("embedFonts", true);
photobooth_ShotDelayValue_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_ShotDelayValue_label.text = myXML.photoboothShotDelay;
photobooth_ShotDelayValue_label.move(463.85,446.45);
addChild(photobooth_ShotDelayValue_label);
photobooth_ShotDelayValue_label.visible = false;
photobooth_PhotoPreviewDuration_label.autoSize = TextFieldAutoSize.RIGHT;
photobooth_PhotoPreviewDuration_label.setStyle("embedFonts", true);
photobooth_PhotoPreviewDuration_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_PhotoPreviewDuration_label.text = "Photos Preview Duration (s)";
photobooth_PhotoPreviewDuration_label.x = 17.25;
photobooth_PhotoPreviewDuration_label.y = 489.25;
photobooth_PhotoPreviewDuration_label.width = 200;
photobooth_PhotoPreviewDuration_label.height = 18;
addChild(photobooth_PhotoPreviewDuration_label);
photobooth_PhotoPreviewDuration_label.visible = false;
photobooth_PhotoPreviewDuration_slider.x = 245.25;
photobooth_PhotoPreviewDuration_slider.y = 496.75;
photobooth_PhotoPreviewDuration_slider.width = 203.90;
photobooth_PhotoPreviewDuration_slider.height = 3;
photobooth_PhotoPreviewDuration_slider.maximum = 30;
photobooth_PhotoPreviewDuration_slider.minimum = 5;
photobooth_PhotoPreviewDuration_slider.snapInterval = 5;
photobooth_PhotoPreviewDuration_slider.tickInterval = 5;
photobooth_PhotoPreviewDuration_slider.value = myXML.photoboothGalleryTimer;
addChild(photobooth_PhotoPreviewDuration_slider);
photobooth_PhotoPreviewDuration_slider.visible = false;
photobooth_PhotoPreviewDuration_slider.addEventListener(SliderEvent.THUMB_DRAG, photobooth_PhotoPreviewDuration_sliderEvent);
photobooth_PhotoPreviewDurationValue_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_PhotoPreviewDurationValue_label.setStyle("embedFonts", true);
photobooth_PhotoPreviewDurationValue_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_PhotoPreviewDurationValue_label.text = myXML.photoboothGalleryTimer;
photobooth_PhotoPreviewDurationValue_label.move(463.85,487.25);
addChild(photobooth_PhotoPreviewDurationValue_label);
photobooth_PhotoPreviewDurationValue_label.visible = false;
photoboothProofPreview_check.x = 78;
photoboothProofPreview_check.y = 524.40;
photoboothProofPreview_check.width = 155;
photoboothProofPreview_check.height = 22;
photoboothProofPreview_check.textField.autoSize = TextFieldAutoSize.LEFT;
photoboothProofPreview_check.setStyle("textFormat", photoboothTextLabelFormat);
photoboothProofPreview_check.label = "Enable Proof Preview";
addChild(photoboothProofPreview_check);
photoboothProofPreview_check.visible = false;
photoboothFacialRecognitionTrigger_check.x = 300;
photoboothFacialRecognitionTrigger_check.y = 524.40;
photoboothFacialRecognitionTrigger_check.width = 400;
photoboothFacialRecognitionTrigger_check.height = 22;
photoboothFacialRecognitionTrigger_check.textField.autoSize = TextFieldAutoSize.LEFT;
photoboothFacialRecognitionTrigger_check.setStyle("textFormat", photoboothTextLabelFormat);
photoboothFacialRecognitionTrigger_check.label = "Enable Photobooth Start on Webcam Facial Recognition";
addChild(photoboothFacialRecognitionTrigger_check);
photoboothFacialRecognitionTrigger_check.visible = false;
photobooth_ProofPreviewDuration_label.autoSize = TextFieldAutoSize.RIGHT;
photobooth_ProofPreviewDuration_label.setStyle("embedFonts", true);
photobooth_ProofPreviewDuration_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_ProofPreviewDuration_label.text = "Proof Preview Duration (s)";
photobooth_ProofPreviewDuration_label.x = 16.25;
photobooth_ProofPreviewDuration_label.y = 567.65;
photobooth_ProofPreviewDuration_label.width = 200;
photobooth_ProofPreviewDuration_label.height = 18;
//photobooth_ProofPreviewDuration_label.move(16.25,567.65);
addChild(photobooth_ProofPreviewDuration_label);
photobooth_ProofPreviewDuration_label.visible = false;
photobooth_ProofPreviewDuration_slider.x = 245.25;
photobooth_ProofPreviewDuration_slider.y = 575.15;
photobooth_ProofPreviewDuration_slider.width = 203.90;
photobooth_ProofPreviewDuration_slider.height = 3;
photobooth_ProofPreviewDuration_slider.maximum = 16;
photobooth_ProofPreviewDuration_slider.minimum = 4;
photobooth_ProofPreviewDuration_slider.snapInterval = 2;
photobooth_ProofPreviewDuration_slider.tickInterval = 2;
photobooth_ProofPreviewDuration_slider.value = myXML.photoboothProofDisplayTime;
addChild(photobooth_ProofPreviewDuration_slider);
photobooth_ProofPreviewDuration_slider.visible = false;
photobooth_ProofPreviewDuration_slider.addEventListener(SliderEvent.THUMB_DRAG, photobooth_ProofPreviewDuration_sliderEvent);
photobooth_ProofPreviewDurationValue_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_ProofPreviewDurationValue_label.setStyle("embedFonts", true);
photobooth_ProofPreviewDurationValue_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_ProofPreviewDurationValue_label.text = myXML.photoboothProofDisplayTime;
photobooth_ProofPreviewDurationValue_label.move(463.85,565.65);
addChild(photobooth_ProofPreviewDurationValue_label);
photobooth_ProofPreviewDurationValue_label.visible = false;
photobooth_PaperSize_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_PaperSize_label.setStyle("embedFonts", true);
photobooth_PaperSize_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_PaperSize_label.text = "Paper Size";
photobooth_PaperSize_label.x = 209.35;
photobooth_PaperSize_label.y = 128.35;
photobooth_PaperSize_label.width = 65;
photobooth_PaperSize_label.height = 18;
addChild(photobooth_PaperSize_label);
photobooth_PaperSize_label.visible = false;
photobooth_PrintingInfo_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_PrintingInfo_label.setStyle("embedFonts", true);
photobooth_PrintingInfo_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_PrintingInfo_label.text = "The Photobooth will print to your default printer in Portrait mode";
photobooth_PrintingInfo_label.x = 459.9;
photobooth_PrintingInfo_label.y = 128.35;
photobooth_PrintingInfo_label.width = 392;
photobooth_PrintingInfo_label.height = 18;
addChild(photobooth_PrintingInfo_label);
photobooth_PrintingInfo_label.visible = false;
photobooth_BackgroundImage_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_BackgroundImage_label.setStyle("embedFonts", true);
photobooth_BackgroundImage_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_BackgroundImage_label.text = "Background Image:";
photobooth_BackgroundImage_label.x = 285.05;
photobooth_BackgroundImage_label.y = 609.40;
photobooth_BackgroundImage_label.width = 149.4;
photobooth_BackgroundImage_label.height = 18;
addChild(photobooth_BackgroundImage_label);
photobooth_BackgroundImage_label.visible = false;
//photoboothOverlayImagePath = File.applicationDirectory; //this is used later for the photobooth path
photoboothOverlayImagePath = file2.resolvePath(myXML.photobooth_backgroundcustomimagepath);
//photoboothLogoPath = File.applicationDirectory; //this is used later for the photobooth path
photoboothLogoPath = file2.resolvePath(myXML.photobooth_logoPath);
photobooth_BackgroundImagePath_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_BackgroundImagePath_label.wordWrap = true;
photobooth_BackgroundImagePath_label.setStyle("embedFonts", true);
photobooth_BackgroundImagePath_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_BackgroundImagePath_label.text = String(photoboothOverlayImagePath.nativePath);
//photobooth_BackgroundImagePath_label.text = String(homepath + myXML.photobooth_backgroundcustomimagepath);
photobooth_BackgroundImagePath_label.x = 413;
photobooth_BackgroundImagePath_label.y = 609.40;
photobooth_BackgroundImagePath_label.width = 475.8;
photobooth_BackgroundImagePath_label.height = 36;
addChild(photobooth_BackgroundImagePath_label);
photobooth_BackgroundImagePath_label.visible = false;
photobooth_LogoImage_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_LogoImage_label.setStyle("embedFonts", true);
photobooth_LogoImage_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_LogoImage_label.text = "Logo Image:";
photobooth_LogoImage_label.x = 284;
photobooth_LogoImage_label.y = 288;
photobooth_LogoImage_label.width = 92;
photobooth_LogoImage_label.height = 18;
addChild(photobooth_LogoImage_label);
photobooth_LogoImage_label.visible = false;
photobooth_LogoImagePath_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_LogoImagePath_label.wordWrap = true;
photobooth_LogoImagePath_label.setStyle("embedFonts", true);
photobooth_LogoImagePath_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_LogoImagePath_label.text = String(photoboothLogoPath.nativePath);
//photobooth_LogoImagePath_label.text = String(homepath + myXML.photobooth_logoPath);
photobooth_LogoImagePath_label.x = 376;
photobooth_LogoImagePath_label.y = 288;
photobooth_LogoImagePath_label.width = 620;
photobooth_LogoImagePath_label.height = 40;
addChild(photobooth_LogoImagePath_label);
photobooth_LogoImagePath_label.visible = false;
photobooth_StartupText_label.autoSize = TextFieldAutoSize.LEFT;
photobooth_StartupText_label.setStyle("embedFonts", true);
photobooth_StartupText_label.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_StartupText_label.text = "Start Up Text";
photobooth_StartupText_label.move(138.45, 648.40);
addChild(photobooth_StartupText_label);
photobooth_StartupText_label.visible = false;
photobooth_StartupText_textarea.embedFonts = true;
photobooth_StartupText_textarea.selectable = true;
photobooth_StartupText_textarea.type = TextFieldType.INPUT;
photobooth_StartupText_textarea.background = true;
photobooth_StartupText_textarea.backgroundColor = 0xFFFFFF; //white
photobooth_StartupText_textarea.maxChars = 140;
photobooth_StartupText_textarea.antiAliasType = AntiAliasType.ADVANCED;
photobooth_StartupText_textarea.defaultTextFormat = TTSTextFormat;
photobooth_StartupText_textarea.x = 240.25;
photobooth_StartupText_textarea.y = 648.40;
photobooth_StartupText_textarea.width = 700;
photobooth_StartupText_textarea.height = 18;
photobooth_StartupText_textarea.text = myXML.photobooth_startuptext;
addChild(photobooth_StartupText_textarea);
photobooth_StartupText_textarea.visible = false;
photobooth_LogoImage_check.x = 76;
photobooth_LogoImage_check.y = 285;
photobooth_LogoImage_check.width = 208;
photobooth_LogoImage_check.height = 22;
photobooth_LogoImage_check.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_LogoImage_check.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_LogoImage_check.label = "Include Custom Logo";
addChild(photobooth_LogoImage_check);
photobooth_LogoImage_check.visible = false;
photobooth_BackgroundImage_check.x = 78;
photobooth_BackgroundImage_check.y = 607.4;
photobooth_BackgroundImage_check.width = 250;
photobooth_BackgroundImage_check.height = 22;
photobooth_BackgroundImage_check.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_BackgroundImage_check.setStyle("textFormat", photoboothTextLabelFormat);
photobooth_BackgroundImage_check.label = "Overlay Background Image";
addChild(photobooth_BackgroundImage_check);
photobooth_BackgroundImage_check.visible = false;
//*****************************
photobooth_fps_label.embedFonts = true;
photobooth_fps_label.antiAliasType = AntiAliasType.ADVANCED;
photobooth_fps_label.defaultTextFormat = photoboothTextLabelFormat;
photobooth_fps_label.x = 10;
photobooth_fps_label.y = 310;
photobooth_fps_label.width = 200;
photobooth_fps_label.height = 18;
photobooth_fps_label.text = "Webcam Frames per Second";
addChild(photobooth_fps_label);
photobooth_fps_label.visible = false;
photobooth_fps.embedFonts = true;
photobooth_fps.selectable = true;
photobooth_fps.type = TextFieldType.INPUT;
photobooth_fps.background = true;
photobooth_fps.backgroundColor = 0xFFFFFF; //white
photobooth_fps.maxChars = 90;
photobooth_fps.antiAliasType = AntiAliasType.ADVANCED;
photobooth_fps.defaultTextFormat = photoboothTextLabelFormat;
photobooth_fps.x = 200;
photobooth_fps.y = 310;
photobooth_fps.width = 30;
photobooth_fps.height = 18;
photobooth_fps.text = myXML.photobooth_fps;
addChild(photobooth_fps);
photobooth_fps.visible = false;
photobooth_printing_radio_on.x = 10;
photobooth_printing_radio_on.y = 40;
photobooth_printing_radio_on.setStyle("textFormat", radiotext);
photobooth_printing_radio_on.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_printing_radio_on.label = "Photobooth Printing ON";
photobooth_printing_radio_off.x = 300;
photobooth_printing_radio_off.y = 40;
photobooth_printing_radio_off.setStyle("textFormat", radiotext);
photobooth_printing_radio_off.textField.autoSize = TextFieldAutoSize.LEFT;
photobooth_printing_radio_off.label = "Photobooth Printing Off";
addChild (photobooth_printing_radio_on);
addChild (photobooth_printing_radio_off);
photobooth_printing_radio_on.visible = false;
photobooth_printing_radio_off.visible = false;
black_square.graphics.lineStyle(1,0x000000);
black_square.graphics.beginFill(0x000000);
black_square.graphics.drawRect(0,0,stage.stageWidth,stage.stageHeight);
black_square.graphics.endFill();
black_square.x = stage.stageWidth/2-black_square.width/2;
black_square.y = stage.stageHeight/2-black_square.height/2;
addChildAt(black_square,1);
black_square.visible = false;
twitter_username_input.text = myXML.twitter_username;
//twitter_password_input.text = myXML.twitter_password; //no longer used with oAuth now
twitter_frequency_input.text = myXML.twitter_frequency;
twitter_search_term_input.text = myXML.twitter_search_term;
if (myXML.twitter_my_tweets_only == "on") {
only_my_tweets_checkbox.selected = true ;
}
else {
only_my_tweets_checkbox.selected = false ;
}
if (myXML.twitter_do_not_speak_search_term == "on") {
do_not_speak_twitter_search_term_checkbox.selected = true ;
}
else {
do_not_speak_twitter_search_term_checkbox.selected = false ;
}
if (myXML.twitter_feature == "on") {
twitter_radio_on.selected = true;
}
else {twitter_radio_off.selected = true;
}
if (myXML.twitter_breathalyzer == "on") {
tweetBreathalyzer_checkbox.selected = true ;
}
else {
tweetBreathalyzer_checkbox.selected = false ;
}
//if (myXML.twitter_mode == "user") {
//twitter_mode_radio_user.selected = true;
//twitter_search_term_input.enabled = false;
//do_not_speak_twitter_search_term_checkbox.enabled = false;
//}
//else {
//twitter_mode_radio_search.selected = true; //we're in twitter search mode
//twitter_username_input.enabled = false;
//twitter_password_input.enabled = false;
//only_my_tweets_checkbox.enabled = false;
//}
if (myXML.stand_alone == "on") {
StandAloneCheck.selected = true ;
}
else {
StandAloneCheck.selected = false ;
}
if (myXML.twitter_mode == "user") {
twitter_mode_radio_user.selected = true;
twitter_search_term_input.enabled = false;
do_not_speak_twitter_search_term_checkbox.enabled = false;
}
if (myXML.twitter_mode == "search") {
twitter_mode_radio_search.selected = true; //we're in twitter search mode
only_my_tweets_checkbox.enabled = false;
}
if (myXML.twitter_mode == "mentions") {
twitter_mode_radio_mentions.selected = true; //we're in twitter search mode
only_my_tweets_checkbox.enabled = false;
twitter_search_term_input.enabled = false;
}
if (myXML.twitter_authenticated == "yes") {
twitterAuthButton.label = "Change Twitter Account";
twitter_username_input.text = myXML.twitter_username;
}
else {
twitterAuthButton.label = "Link Twitter Account";
twitter_username_input.text = "";
}
var house_temp2:String;
house_temp2 = myXML.x10_house2;
trace(house_temp2);
switch (house_temp2) //sets the video playlists based on the mode
{
case "A":
onoff_house_code_input.selectedIndex = 0;
break;
case "B": //tropical storm
onoff_house_code_input.selectedIndex = 1;
break;
case "C": //hurricane
onoff_house_code_input.selectedIndex = 2;
break;
case "D": //hurricane
onoff_house_code_input.selectedIndex = 3;
break;
case "E": //hurricane
onoff_house_code_input.selectedIndex = 4;
break;
case "F": //hurricane
onoff_house_code_input.selectedIndex = 5;
break;
case "G": //hurricane
onoff_house_code_input.selectedIndex = 6;
break;
case "H":
onoff_house_code_input.selectedIndex = 7;
break;
case "I": //tropical storm
onoff_house_code_input.selectedIndex = 8;
break;
case "J": //hurricane
onoff_house_code_input.selectedIndex = 9;
break;
case "K": //hurricane
onoff_house_code_input.selectedIndex = 10;
break;
case "L": //hurricane
onoff_house_code_input.selectedIndex = 11;
break;
case "M": //hurricane
onoff_house_code_input.selectedIndex = 12;
break;
case "N": //hurricane
onoff_house_code_input.selectedIndex = 13;
break;
case "O": //hurricane
onoff_house_code_input.selectedIndex = 14;
break;
case "P": //hurricane
onoff_house_code_input.selectedIndex = 15;
break;
default: //hurricane
onoff_house_code_input.selectedIndex = 0;
break;
}
var unit_temp3:String;
unit_temp3 = myXML.x10_unit2;
switch (unit_temp3) //sets the video playlists based on the mode
{
case "1":
onoff_unit_code_input.selectedIndex = 0;
break;
case "2": //tropical storm
onoff_unit_code_input.selectedIndex = 1;
break;
case "3": //hurricane
onoff_unit_code_input.selectedIndex = 2;
break;
case "4": //hurricane
onoff_unit_code_input.selectedIndex = 3;
break;
case "5": //hurricane
onoff_unit_code_input.selectedIndex = 4;
break;
case "6": //hurricane
onoff_unit_code_input.selectedIndex = 5;
break;
case "7": //hurricane
onoff_unit_code_input.selectedIndex = 6;
break;
case "8":
onoff_unit_code_input.selectedIndex = 7;
break;
case "9": //tropical storm
onoff_unit_code_input.selectedIndex = 8;
break;
case "10": //hurricane
onoff_unit_code_input.selectedIndex = 9;
break;
case "11": //hurricane
onoff_unit_code_input.selectedIndex = 10;
break;
case "12": //hurricane
onoff_unit_code_input.selectedIndex = 11;
break;
case "13": //hurricane
onoff_unit_code_input.selectedIndex = 12;
break;
case "14": //hurricane
onoff_unit_code_input.selectedIndex = 13;
break;
case "15": //hurricane
onoff_unit_code_input.selectedIndex = 14;
break;
case "16": //hurricane
onoff_unit_code_input.selectedIndex = 15;
break;
default: //hurricane
onoff_unit_code_input.selectedIndex = 0;
break;
}
var webcam_restemp2:String;
webcam_restemp2 = myXML.photobooth_videoWidth;
switch (webcam_restemp2)
{
case "160":
photobooth_WebcamResolution_dropdown.selectedIndex = 0;
break;
case "320":
photobooth_WebcamResolution_dropdown.selectedIndex = 1;
break;
case "480":
photobooth_WebcamResolution_dropdown.selectedIndex = 2;
break;
case "640":
photobooth_WebcamResolution_dropdown.selectedIndex = 3;
break;
case "720":
photobooth_WebcamResolution_dropdown.selectedIndex = 4;
break;
case "1080":
photobooth_WebcamResolution_dropdown.selectedIndex = 5;
break;
default:
photobooth_WebcamResolution_dropdown.selectedIndex = 1;
}
var photobooth_papertemp2:String;
photobooth_papertemp2 = myXML.photobooth_papersize;
switch (photobooth_papertemp2)
{
case "A6":
photobooth_PaperSize_dropdown.selectedIndex = 0;
break;
case "Letter":
photobooth_PaperSize_dropdown.selectedIndex = 1;
break;
default:
photobooth_PaperSize_dropdown.selectedIndex = 0;
}
if (myXML.photobooth_printing == "on") {
photobooth_printing_radio_on.selected = true;
}
else {photobooth_printing_radio_off.selected = true;
}
if (myXML.photobooth_printing == "on") {
photobooth_printing_check.selected = true ;
}
else {
photobooth_printing_check.selected = false ;
}
if (myXML.photobooth_promptprint == "on") {
photobooth_promptprint_check.selected = true ;
}
else {
photobooth_promptprint_check.selected = false ;
}
if (myXML.photobooth_save == "on") {
photobooth_save_check.selected = true ;
}
else {
photobooth_save_check.selected = false ;
}
if (myXML.photobooth_x10 == "on") {
photobooth_x10_check.selected = true ;
}
else {
photobooth_x10_check.selected = false ;
}
if (myXML.photobooth_leds == "on") {
photobooth_leds_check.selected = true ;
}
else {
photobooth_leds_check.selected = false ;
}
if (myXML.photoboothProofPreview == "on") {
photoboothProofPreview_check.selected = true ;
}
else {
photoboothProofPreview_check.selected = false ;
}
if (myXML.photobooth_facialRecognitionTrigger == "on") {
photoboothFacialRecognitionTrigger_check.selected = true ;
}
else {
photoboothFacialRecognitionTrigger_check.selected = false ;
}
if (myXML.photobooth_backgroundcustomimage == "on") {
photobooth_BackgroundImage_check.selected = true ;
}
else {
photobooth_BackgroundImage_check.selected = false ;
}
if (myXML.photobooth_logo == "on") {
photobooth_LogoImage_check.selected = true ;
}
else {
photobooth_LogoImage_check.selected = false ;
}
if (photoboothProofPreview_check.selected == false) {
photobooth_ProofPreviewDuration_slider.enabled = false;
photobooth_ProofPreviewDuration_label.enabled = false;
}
else {
photobooth_ProofPreviewDuration_slider.enabled = true;
photobooth_ProofPreviewDuration_label.enabled = true;
}
if (photobooth_printing_check.selected == false) {
photobooth_PaperSize_dropdown.enabled = false;
photobooth_promptprint_check.enabled = false;
photobooth_PrintCopies_slider.enabled = false;
}
else {
photobooth_PaperSize_dropdown.enabled = true;
photobooth_promptprint_check.enabled = true;
photobooth_PrintCopies_slider.enabled = true;
}
}
//private function TwitterModeChanged(event:Event):void {
//if (twitter_mode_radio_user.selected == true) { //we're in twitter user mode so grey out the search stuff
// twitter_search_term_input.enabled = false;
// do_not_speak_twitter_search_term_checkbox.enabled = false;
// twitter_username_input.enabled = true;
// only_my_tweets_checkbox.enabled = true;
//}
//else {
// twitter_username_input.enabled = false;
// only_my_tweets_checkbox.enabled = false;
// twitter_search_term_input.enabled = true;
// do_not_speak_twitter_search_term_checkbox.enabled = true;
// }
//}
private function TwitterModeChanged(event:Event):void {
if (twitter_mode_radio_user.selected == true) { //we're in twitter user mode so grey out the search stuff
twitter_search_term_input.enabled = false;
do_not_speak_twitter_search_term_checkbox.enabled = false;
//twitter_username_input.enabled = true;
//twitter_password_input.enabled = true;
//twitter_frequency_input.enabled = true;
only_my_tweets_checkbox.enabled = true;
}
if (twitter_mode_radio_mentions.selected == true) { //we're in mentions mode
twitter_search_term_input.enabled = false;
do_not_speak_twitter_search_term_checkbox.enabled = false;
//twitter_password_input.enabled = false;
only_my_tweets_checkbox.enabled = false;
}
if (twitter_mode_radio_search.selected == true) { //we're in mentions mode
twitter_username_input.enabled = false; //we're in search mode
//twitter_password_input.enabled = false;
only_my_tweets_checkbox.enabled = false;
twitter_search_term_input.enabled = true;
do_not_speak_twitter_search_term_checkbox.enabled = true;
}
}
private function TTSEngineChanged(event:Event):void {
/*first we need to remove all the items
secondly add them back
third make the default selection based on the XML settings*/
//step 1 - clear all values
TTS_languages_dropdown.removeAll();
//step 2 and 3 - add all items based on which radio button is picked
if (tts_engine_voicerss.selected == true) {
populateVoiceRSSLanguageDropdown(); //put these into a function as we need to call from other places too so it will make maintenance easier if these ever change
setVoiceRSSDropDownfromXML();
trace("Voice RSS radio button changed");
}
else {
populateYakitomeLanguageDropdown();
setYakitomeDropDownfromXML();
trace("Yakimote radio button changed");
}
}
private function populateVoiceRSSLanguageDropdown():void {
TTS_languages_dropdown.addItem( { label: "Catalan Female", data:"ca-es" } );
TTS_languages_dropdown.addItem( { label: "Chinese (China) Female", data:"zh-cn" } );
TTS_languages_dropdown.addItem( { label: "Chinese (Hong Kong) Female", data:"zh-hk" } );
TTS_languages_dropdown.addItem( { label: "Chinese (Taiwan) Female", data:"zh-tw" } );
TTS_languages_dropdown.addItem( { label: "Danish Female", data:"da-dk" } );
TTS_languages_dropdown.addItem( { label: "Dutch Female", data:"nl-nl" } );
TTS_languages_dropdown.addItem( { label: "English (Australia) Female", data:"en-au" } );
TTS_languages_dropdown.addItem( { label: "English (Canada) Female", data:"en-ca" } );
TTS_languages_dropdown.addItem( { label: "English (Great Britain) Female", data:"en-gb" } );
TTS_languages_dropdown.addItem( { label: "English (India) Female", data:"en-in" } );
TTS_languages_dropdown.addItem( { label: "English (United States) Female", data:"en-us" } );
TTS_languages_dropdown.addItem( { label: "Finnish Female", data:"fi-fi" } );
TTS_languages_dropdown.addItem( { label: "French (Canada) Female", data:"fr-ca" } );
TTS_languages_dropdown.addItem( { label: "French (France) Female", data:"fr-fr" } );
TTS_languages_dropdown.addItem( { label: "German Female", data:"de-de" } );
TTS_languages_dropdown.addItem( { label: "Italian Female", data:"it-it" } );
TTS_languages_dropdown.addItem( { label: "Japanese Female", data:"ja-jp" } );
TTS_languages_dropdown.addItem( { label: "Korean Female", data:"ko-kr" } );
TTS_languages_dropdown.addItem( { label: "Norwegian Female", data:"nb-no" } );
TTS_languages_dropdown.addItem( { label: "Polish Female", data:"pl-pl" } );
TTS_languages_dropdown.addItem( { label: "Portuguese (Brazil) Female", data:"pt-br" } );
TTS_languages_dropdown.addItem( { label: "Portuguese (Portugal) Female", data:"pt-pt" } );
TTS_languages_dropdown.addItem( { label: "Russian Female", data:"ru-ru" } );
TTS_languages_dropdown.addItem( { label: "Spanish (Mexico) Female", data:"es-mx" } );
TTS_languages_dropdown.addItem( { label: "Spanish (Spain) Female", data:"es-es" } );
TTS_languages_dropdown.addItem( { label: "Swedish (Sweden) Female", data:"sv-se" } );
}
private function populateYakitomeLanguageDropdown():void {
TTS_languages_dropdown.addItem( { label: "German Female", data:"Klara" } );
TTS_languages_dropdown.addItem( { label: "German Male", data:"Reiner" } );
TTS_languages_dropdown.addItem( { label: "Spanish Male", data:"Alberto" } );
TTS_languages_dropdown.addItem( { label: "French Candadian Male", data:"Arnaud" } );
TTS_languages_dropdown.addItem( { label: "French Female", data:"Juliette" } );
TTS_languages_dropdown.addItem( { label: "French Male", data:"Alain" } );
TTS_languages_dropdown.addItem( { label: "UK Female", data:"Anjali" } );
TTS_languages_dropdown.addItem( { label: "UK Female 2", data:"Audrey" } );
TTS_languages_dropdown.addItem( { label: "US Female", data:"Crystal" } );
TTS_languages_dropdown.addItem( { label: "US Female 2", data:"Julia" } );
TTS_languages_dropdown.addItem( { label: "US Female 3", data:"Lauren" } );
TTS_languages_dropdown.addItem( { label: "US Female 4", data:"Randy" } );
TTS_languages_dropdown.addItem( { label: "US Male Default", data:"Dave" } );
TTS_languages_dropdown.addItem( { label: "US Male", data:"Mike" } );
}
private function photobooth_PrintCopies_sliderEvent(event:SliderEvent):void {
photobooth_PrintCopiesValue_label.text = String(event.value);
}
private function photobooth_WebcamFPS_sliderEvent(event:SliderEvent):void {
photobooth_WebcamFPSValue_label.text = String(event.value);
}
private function photobooth_CountDownFrom_sliderEvent(event:SliderEvent):void {
photobooth_CountDownFromValue_label.text = String(event.value);
}
private function photobooth_ShotDelay_sliderEvent(event:SliderEvent):void {
photobooth_ShotDelayValue_label.text = String(event.value);
}
private function photobooth_PhotoPreviewDuration_sliderEvent(event:SliderEvent):void {
photobooth_PhotoPreviewDurationValue_label.text = String(event.value);
}
private function photobooth_ProofPreviewDuration_sliderEvent(event:SliderEvent):void {
photobooth_ProofPreviewDurationValue_label.text = String(event.value);
}
private function PopulateValues():void {
// //*** now set the TTL language
//var language_temp:String;
////language_temp = myXML.tts_language;
//language_temp = myXML.ttsrss_language
//
// switch (language_temp)
// {
// case "ca-es":
// TTS_languages_dropdown.selectedIndex = 0;
// break;
// case "zh-cn":
// TTS_languages_dropdown.selectedIndex = 1;
// break;
// case "zh-hk":
// TTS_languages_dropdown.selectedIndex = 2;
// break;
// case "zh-tw":
// TTS_languages_dropdown.selectedIndex = 3;
// break;
// case "da-dk":
// TTS_languages_dropdown.selectedIndex = 4;
// break;
// case "nl-nl":
// TTS_languages_dropdown.selectedIndex = 5;
// break;
// case "en-au":
// TTS_languages_dropdown.selectedIndex = 6;
// break;
// case "en-ca":
// TTS_languages_dropdown.selectedIndex = 7;
// break;
// case "en-gb":
// TTS_languages_dropdown.selectedIndex = 8;
// break;
// case "en-in":
// TTS_languages_dropdown.selectedIndex = 9;
// break;
// case "en-us":
// TTS_languages_dropdown.selectedIndex = 10;
// break;
// case "fi-fi":
// TTS_languages_dropdown.selectedIndex = 11;
// break;
// case "fr-ca":
// TTS_languages_dropdown.selectedIndex = 12;
// break;
// case "fr-fr":
// TTS_languages_dropdown.selectedIndex = 13;
// break;
// case "de-de":
// TTS_languages_dropdown.selectedIndex = 14;
// break;
// case "it-it":
// TTS_languages_dropdown.selectedIndex = 15;
// break;
// case "ja-jp":
// TTS_languages_dropdown.selectedIndex = 16;
// break;
// case "ko-kr":
// TTS_languages_dropdown.selectedIndex = 17;
// break;
// case "nb-no":
// TTS_languages_dropdown.selectedIndex = 18;
// break;
// case "pl-pl":
// TTS_languages_dropdown.selectedIndex = 19;
// break;
// case "pt-br":
// TTS_languages_dropdown.selectedIndex = 20;
// break;
// case "pt-pt":
// TTS_languages_dropdown.selectedIndex = 21;
// break;
// case "ru-ru":
// TTS_languages_dropdown.selectedIndex = 22;
// break;
// case "es-mx":
// TTS_languages_dropdown.selectedIndex = 23;
// break;
// case "es-es":
// TTS_languages_dropdown.selectedIndex = 24;
// break;
// case "sv-se":
// TTS_languages_dropdown.selectedIndex = 25;
// break;
// default:
// TTS_languages_dropdown.selectedIndex = 8;
// }
if (myXML.tts_feature == "on") {
tts_feature_radio_on.selected = true;
}
else {tts_feature_radio_off.selected = true;
}
if (myXML.tts_engine == "voicerss") {
setVoiceRSSDropDownfromXML();
}
else if (myXML.tts_engine == "yakitome") {
setYakitomeDropDownfromXML();
}
else {
setVoiceRSSDropDownfromXML();
tts_engine_voicerss.selected == true;
trace("we got no match for the TTS engine from the XML, so let's just set it to voicerss as the default");
}
if (myXML.tts_engine == "voicerss") { //this is the default
tts_engine_voicerss.selected = true;
}
else {tts_engine_yakitome.selected = true;
}
switch5_radio_on.x = 250;
switch5_radio_on.y = 94;
switch5_radio_on.setStyle("textFormat", radiotext);
switch5_radio_on.textField.autoSize = TextFieldAutoSize.LEFT;
switch5_radio_on.label = "ON";
switch5_radio_off.x = 330;
switch5_radio_off.y = 94;
switch5_radio_off.setStyle("textFormat", radiotext);
switch5_radio_off.textField.autoSize = TextFieldAutoSize.LEFT;
switch5_radio_off.label = "OFF";
addChild (switch5_radio_on);
addChild (switch5_radio_off);
switch4_radio_on.x = 250;
switch4_radio_on.y = 268;
switch4_radio_on.setStyle("textFormat", radiotext);
switch4_radio_on.textField.autoSize = TextFieldAutoSize.LEFT;
switch4_radio_on.label = "ON";
switch4_radio_off.x = 330;
switch4_radio_off.y = 268;
switch4_radio_off.setStyle("textFormat", radiotext);
switch4_radio_off.textField.autoSize = TextFieldAutoSize.LEFT;
switch4_radio_off.label = "OFF";
addChild (switch4_radio_on);
addChild (switch4_radio_off);
analog1_radio_on.x = 250;
analog1_radio_on.y = 129;
analog1_radio_on.setStyle("textFormat", radiotext);
analog1_radio_on.textField.autoSize = TextFieldAutoSize.LEFT;
analog1_radio_on.label = "ON";
analog1_radio_off.x = 330;
analog1_radio_off.y = 128;
analog1_radio_off.setStyle("textFormat", radiotext);
analog1_radio_off.textField.autoSize = TextFieldAutoSize.LEFT;
analog1_radio_off.label = "OFF";
addChild (analog1_radio_on);
addChild (analog1_radio_off);
analog2_radio_on.x = 250;
analog2_radio_on.y = 163;
analog2_radio_on.setStyle("textFormat", radiotext);
analog2_radio_on.textField.autoSize = TextFieldAutoSize.LEFT;
analog2_radio_on.label = "ON";
analog2_radio_off.x = 330;
analog2_radio_off.y = 163;
analog2_radio_off.setStyle("textFormat", radiotext);
analog2_radio_off.textField.autoSize = TextFieldAutoSize.LEFT;
analog2_radio_off.label = "OFF";
addChild (analog2_radio_on);
addChild (analog2_radio_off);
analog3_radio_on.x = 250;
analog3_radio_on.y = 198;
analog3_radio_on.setStyle("textFormat", radiotext);
analog3_radio_on.textField.autoSize = TextFieldAutoSize.LEFT;
analog3_radio_on.label = "ON";
analog3_radio_off.x = 330;
analog3_radio_off.y = 198;
analog3_radio_off.setStyle("textFormat", radiotext);
analog3_radio_off.textField.autoSize = TextFieldAutoSize.LEFT;
analog3_radio_off.label = "OFF";
addChild (analog3_radio_on);
addChild (analog3_radio_off);
reg_code_input.text = myXML.reg_code;
zip_code_input.text = myXML.weather_zip;
woeid_input.text = myXML.weather_woeid;
stock_good_threshold_input.text = myXML.stock_good_threshold;
stock_bad_threshold_input.text = myXML.stock_bad_threshold;
if (reg_code_input.text == "440537" || reg_code_input.text == "110534" || reg_code_input.text == "768223" || reg_code_input.text == "998765" || reg_code_input.text == "233229" || reg_code_input.text == "643229" || reg_code_input.text == "876233" ) {
registered.text = "REGISTERED"
reg_code_input.editable = false;
reg_code_input.enabled = false;
}
if (myXML.switch5 == "on") {
switch5_radio_on.selected = true;
}
else {switch5_radio_off.selected = true;
}
if (myXML.switch4 == "on") {
switch4_radio_on.selected = true;
}
else {
switch4_radio_off.selected = true;
}
if (myXML.analog_input1 == "on") {
analog1_radio_on.selected = true;
}
else {analog1_radio_off.selected = true;
}
if (myXML.analog_input2 == "on") {
analog2_radio_on.selected = true;
trace ("went here");
}
else {analog2_radio_off.selected = true;
}
if (myXML.analog3_prox == "on") {
analog3_radio_on.selected = true;
}
else {analog3_radio_off.selected = true;
}
var stockArray:Array = new Array();
var i:int = 0;
for each (var item:XML in myXML.stocks.symbol)
{
stockArray.push(myXML.stocks.symbol[i]);
i++;
}
var num_stocks = stockArray.length;
var stock_string:String = stockArray.join("+");
//trace (stock_string);
stock_list.text = stock_string;
tts_url.text = myXML.tts_url;
}
private function setVoiceRSSDropDownfromXML():void {
var language:String = myXML.ttsrss_language;
switch (language) //IMPORTANT evidently you can't switch on myXML.x so that's why we added the temp language string
{
case "ca-es":
TTS_languages_dropdown.selectedIndex = 0;
break;
case "zh-cn":
TTS_languages_dropdown.selectedIndex = 1;
break;
case "zh-hk":
TTS_languages_dropdown.selectedIndex = 2;
break;
case "zh-tw":
TTS_languages_dropdown.selectedIndex = 3;
break;
case "da-dk":
TTS_languages_dropdown.selectedIndex = 4;
break;
case "nl-nl":
TTS_languages_dropdown.selectedIndex = 5;
break;
case "en-au":
TTS_languages_dropdown.selectedIndex = 6;
break;
case "en-ca":
TTS_languages_dropdown.selectedIndex = 7;
break;
case "en-gb":
TTS_languages_dropdown.selectedIndex = 8;
break;
case "en-in":
TTS_languages_dropdown.selectedIndex = 9;
break;
case "en-us":
TTS_languages_dropdown.selectedIndex = 10;
break;
case "fi-fi":
TTS_languages_dropdown.selectedIndex = 11;
break;
case "fr-ca":
TTS_languages_dropdown.selectedIndex = 12;
break;
case "fr-fr":
TTS_languages_dropdown.selectedIndex = 13;
break;
case "de-de":
TTS_languages_dropdown.selectedIndex = 14;
break;
case "it-it":
TTS_languages_dropdown.selectedIndex = 15;
break;
case "ja-jp":
TTS_languages_dropdown.selectedIndex = 16;
break;
case "ko-kr":
TTS_languages_dropdown.selectedIndex = 17;
break;
case "nb-no":
TTS_languages_dropdown.selectedIndex = 18;
break;
case "pl-pl":
TTS_languages_dropdown.selectedIndex = 19;
break;
case "pt-br":
TTS_languages_dropdown.selectedIndex = 20;
break;
case "pt-pt":
TTS_languages_dropdown.selectedIndex = 21;
break;
case "ru-ru":
TTS_languages_dropdown.selectedIndex = 22;
break;
case "es-mx":
TTS_languages_dropdown.selectedIndex = 23;
break;
case "es-es":
TTS_languages_dropdown.selectedIndex = 24;
break;
case "sv-se":
TTS_languages_dropdown.selectedIndex = 25;
break;
default:
TTS_languages_dropdown.selectedIndex = 8;
}
}
private function setYakitomeDropDownfromXML():void {
var language:String = myXML.ttsyakitome_voice;
switch (language)
{
case "Klara":
TTS_languages_dropdown.selectedIndex = 0;
break;
case "Reiner":
TTS_languages_dropdown.selectedIndex = 1;
break;
case "Alberto":
TTS_languages_dropdown.selectedIndex = 2;
break;
case "Arnaud":
TTS_languages_dropdown.selectedIndex = 3;
break;
case "Juliette":
TTS_languages_dropdown.selectedIndex = 4;
break;
case "Alain":
TTS_languages_dropdown.selectedIndex = 5;
break;
case "Anjali":
TTS_languages_dropdown.selectedIndex = 6;
break;
case "Audrey":
TTS_languages_dropdown.selectedIndex = 7;
break;
case "Crystal":
TTS_languages_dropdown.selectedIndex = 8;
break;
case "Julia":
TTS_languages_dropdown.selectedIndex = 9;
break;
case "Lauren":
TTS_languages_dropdown.selectedIndex = 10;
break;
case "Randy":
TTS_languages_dropdown.selectedIndex = 11;
break;
case "Dave":
TTS_languages_dropdown.selectedIndex = 12;
break;
case "Mike":
TTS_languages_dropdown.selectedIndex = 13;
break;
default:
TTS_languages_dropdown.selectedIndex = 12;
}
}
private function noSerproxyEvent(e:TimerEvent):void { //this will trigger once after the startup delay timer
if (SerproxyRunning == 0) { //show the error box if the Arduno was not found
removeChild(StartupText);
StartupTextFormat.size = 20;
StartupText.autoSize = TextFieldAutoSize.CENTER;
StartupText.embedFonts = true;
StartupText.selectable = false;
StartupTextFormat.color = 0xFF0033; //red
StartupText.antiAliasType = AntiAliasType.ADVANCED;
StartupText.defaultTextFormat = StartupTextFormat;
StartupText.wordWrap = true;
addChild(StartupText);
//StartupText.text = "serproxy.exe is not running, exit this program, run serproxy.exe, and then run this program again.";
output.text = "serproxy.exe is not running, exit this program, run serproxy.exe, and then run this program again.";
arduino_detected.text = "Not Detected";
}
}
private function noArduinoFoundTimerEvent(e:TimerEvent):void { //this will trigger once after the startup delay timer
if (SerproxyRunning == 1 && foundArduino == 0) { //serproxy is running but no Arduino found
removeChild(StartupText);
StartupTextFormat.size = 20;
StartupText.autoSize = TextFieldAutoSize.CENTER;
StartupText.embedFonts = true;
StartupText.selectable = false;
StartupTextFormat.color = 0xFF0033; //red
StartupText.antiAliasType = AntiAliasType.ADVANCED;
StartupText.defaultTextFormat = StartupTextFormat;
StartupText.wordWrap = true;
addChild(StartupText);
//StartupText.text = "I could not find the Magic Mirror Sensor Hub, please ensure the Firmata program has been uploaded to the Magic Mirror Sensor Hub. If you've already uploaded Firmata, then you'll need to set the port manually in the Configuration program.";
output.text = "The Magic Mirror Sensor Hub was not detected, please ensure its plugged into your computer's USB port and you've installed the OS driver. Also make sure the Firmata program has been uploaded to the Magic Mirror Sensor Hub. If you've done both, close the serproxy.exe program, unplug the Sensor Hub, plug back in, and then re-start this program. If its still not detected, then you'll need to set the port manually using the 'Magic Mirror Advanced Setup' program.";
arduino_detected.text = "Not Detected";
}
}
private function onSocketConnect(e:Object):void {
trace("Socket connected!");
SerproxyRunning = 1;
aa.requestFirmwareVersion();
bb.requestFirmwareVersion();
cc.requestFirmwareVersion();
dd.requestFirmwareVersion();
ee.requestFirmwareVersion();
ff.requestFirmwareVersion();
gg.requestFirmwareVersion();
hh.requestFirmwareVersion();
ii.requestFirmwareVersion();
}
private function onReceiveFirmwareVersion(e:ArduinoEvent):void {
//StartupText.visible = false;
foundArduino = 1;
trace("Firmware version: " + e.value);
//here we will see if the firmware version is 5, if so, then it's an Arduino UNO board and we need to setup this in the config program
trace("Port: " + e.port);
ArduinoFound.text = ("Magic Mirror Sensor Hub Found on Port: " + e.port);
removeChild(StartupText);
StartupTextFormat.size = 20;
StartupText.autoSize = TextFieldAutoSize.CENTER;
StartupText.embedFonts = true;
StartupText.selectable = false;
StartupTextFormat.color = 0x00CC33; //green
StartupText.antiAliasType = AntiAliasType.ADVANCED;
StartupText.defaultTextFormat = StartupTextFormat;
StartupText.wordWrap = true;
addChild(StartupText);
//StartupText.text = "I've found the Magic Mirror Sensor Hub and have updated your settings to port: " + e.port + ". You may now exit this program and run the Configuration program.";
//output.text = "I've found the Magic Mirror Sensor Hub and have updated your settings file.";
//AlertManager.createAlert(this, "I've found the Magic Mirror Sensor Hub and have updated your settings to port: " + e.port + ". Please exit this program and run the Configuration program.");
myXML.com_port = String(e.port);
trace(myXML.com_port);
if (e.value == 5.0) { //then it's an Arduino UNO and we need to make sure the board version is set to 5.0
myXML.board_version = 5;
//saveValues();
}
if (e.value == 2.0) {
myXML.board_version = 4;
//saveValues();
}
ArduinoPortSave();
arduino_detected.text = "Detected";
//if (e.value == 5.0) { //then it's an Arduino UNO and we need to make sure the board version is set to 5.0
//myXML.board_version = 5;
//saveValues();
//}
//if (e.value == 2.0) { //then it's an Arduino UNO and we need to make sure the board version is set to 5.0
//myXML.board_version = 4;
//saveValues();
//}
}
// triggered when a serial socket connection has been closed
private function onSocketClose(e:Object):void {
trace("Socket closed!");
}
private function saveValue(event:MouseEvent):void {
saveValues();
}
private function saveValues():void {
/*if ( TTS_languages_dropdown.selectedItem.data == null) {
myXML.tts_language = "en";
}
else {
myXML.tts_language = TTS_languages_dropdown.selectedItem.data;
}*/
/*if ( TTS_languages_dropdown.selectedItem.data == null) {
myXML.ttsrss_language = "en-gb";
}
else {
myXML.ttsrss_language = TTS_languages_dropdown.selectedItem.data;
}*/
if (TTS_languages_dropdown.selectedItem.data == null) {
myXML.ttsrss_language = "en-gb";
myXML.ttsyakitome_voice = "Dave";
}
else {
if (tts_engine_voicerss.selected == true ) {
myXML.ttsrss_language = TTS_languages_dropdown.selectedItem.data;
}
else {
myXML.ttsyakitome_voice = TTS_languages_dropdown.selectedItem.data;
}
}
if (tts_engine_voicerss.selected == true) { //the voicerss tts engine is selected, not yakitome
myXML.tts_engine = "voicerss";
}
else {
myXML.tts_engine = "yakitome";
}
myXML.tts_url = tts_url.text;
if (tts_feature_radio_on.selected == true) {
myXML.tts_feature = "on";
myXML.custom_audio = "off";
}
else {
myXML.tts_feature = "off";
myXML.custom_audio = "on";
}
myXML.proximity1_tts = proximity1_tts.text;
myXML.proximity2_tts = proximity2_tts.text;
myXML.proximity3_tts = proximity3_tts.text;
myXML.weather_good_tts = weather_good_tts.text;
myXML.weather_ok_tts = weather_ok_tts.text;
myXML.weather_rain_tts = weather_rain_tts.text;
myXML.stock_up_tts = stock_up_tts.text;
myXML.stock_no_change_tts = stock_no_change_tts.text;
myXML.stock_down_tts = stock_down_tts.text;
myXML.doorbell_tts = doorbell_tts.text;
myXML.x10_on_tts = x10_on_tts.text;
myXML.x10_off_tts = x10_off_tts.text;
myXML.drink1_tts = drink1_tts.text;
myXML.drink2_tts = drink2_tts.text;
myXML.drink3_tts = drink3_tts.text;
myXML.drink4_tts = drink4_tts.text;
myXML.blow_tts = blow_tts.text;
myXML.wait_tts = wait_tts.text;
myXML.no_internet_tts = no_internet_tts.text;
if (twitter_radio_on.selected == true) {
myXML.twitter_feature = "on";
}
else {myXML.twitter_feature = "off"};
//if (twitter_mode_radio_user.selected == true) { //twitter username and password mode
//myXML.twitter_mode = "user";
//}
//else {myXML.twitter_mode = "search"};
if (twitter_mode_radio_user.selected == true) { //twitter username and password mode
myXML.twitter_mode = "user";
}
if (twitter_mode_radio_mentions.selected == true) { //twitter username and password mode
myXML.twitter_mode = "mentions";
}
if (twitter_mode_radio_search.selected == true) { //twitter username and password mode
myXML.twitter_mode = "search";
}
if (only_my_tweets_checkbox.selected == true) {
myXML.twitter_my_tweets_only = "on";
}
else {
myXML.twitter_my_tweets_only = "off";
}
if (do_not_speak_twitter_search_term_checkbox.selected == true) {
myXML.twitter_do_not_speak_search_term = "on";
}
else {
myXML.twitter_do_not_speak_search_term = "off";
}
if (tweetBreathalyzer_checkbox.selected == true) {
myXML.twitter_breathalyzer = "on";
}
else {
myXML.twitter_breathalyzer = "off";
}
//myXML.twitter_username = twitter_username_input.text;
//myXML.twitter_password = twitter_password_input.text;
myXML.twitter_frequency = twitter_frequency_input.text;
myXML.twitter_search_term = twitter_search_term_input.text;
if (tts_feature_radio_on.selected == true) {
myXML.tts_feature = "on";
}
else {myXML.tts_feature = "off";
}
if (StandAloneCheck.selected == true) {
myXML.stand_alone = "on";
}
else {
myXML.stand_alone = "off";
}
///*******************************
myXML.verbose = "no";
myXML.weather_zip = zip_code_input.text;
myXML.weather_woeid = woeid_input.text;
myXML.stock_good_threshold = stock_good_threshold_input.text;
myXML.stock_bad_threshold = stock_bad_threshold_input.text;
myXML.reg_code = reg_code_input.text;
if (switch5_radio_on.selected == true) { //this is the breathalyzer switch so also set the alcohol sensor to on
myXML.switch5 = "on";
myXML.alcohol_sensor = "on";
}
else {myXML.switch5 = "off";
myXML.alcohol_sensor = "off";
}
if (switch4_radio_on.selected == true) {
myXML.switch4 = "on";
myXML.picasa_insteadofphotobooth = "off";
}
else {
myXML.switch4 = "off";
}
if (analog1_radio_on.selected == true) {
myXML.analog_input1 = "on";
}
else {myXML.analog_input1 = "off";
}
if (analog2_radio_on.selected == true) {
myXML.analog_input2 = "on";
}
else {myXML.analog_input2 = "off";
}
if (analog3_radio_on.selected == true) {
myXML.analog_input3 = "on";
myXML.analog3_prox = "on";
}
else {
myXML.analog_input3 = "off";
myXML.analog3_prox = "off";
}
if (photobooth_printing_radio_on.selected == true) { //photobooth printing is turned on
myXML.photobooth_printing = "on";
}
else {
myXML.photobooth_printing = "off"; //tts is off means custom mp3 is one
}
if (photobooth_printing_check.selected == true) {
myXML.photobooth_printing = "on";
}
else {
myXML.photobooth_printing = "off";
}
if (photobooth_promptprint_check.selected == true) {
myXML.photobooth_promptprint = "on";
}
else {
myXML.photobooth_promptprint = "off";
}
if (photobooth_save_check.selected == true) {
myXML.photobooth_save = "on";
}
else {
myXML.photobooth_save = "off";
}
if (photobooth_x10_check.selected == true) {
myXML.photobooth_x10 = "on";
}
else {
myXML.photobooth_x10 = "off";
}
if (photobooth_leds_check.selected == true) {
myXML.photobooth_leds = "on";
}
else {
myXML.photobooth_leds = "off";
}
if (photoboothProofPreview_check.selected == true) {
myXML.photoboothProofPreview = "on";
}
else {
myXML.photoboothProofPreview = "off";
}
if (photoboothFacialRecognitionTrigger_check.s