********************************************* Project Manual: Marketing Computer Science Author: Brian M. Milinski Professor: Dr. Pankratz Senior Capstone Project ********************************************* INDEX 1. Images 2. Batch Files 3. XML Files 4. Phidgets 5. Launching Programs ********************************************* 1. Images ********************************************* To swap out images there is a folder called 'images' that contains all the images used by the slideshow. This file is managed by an XML file which resides in the 'xml' folder. This file contains the path which is sent to the flash program in order to display each image. The XML file structure for images and how to change them. The naming convention which I chose to use was image1..image2... image3...image4...image5..etc. By adding another to the XML file you can make the slide show have an additional image, or if you delete one of the tags you can shorten the slideshow. You can change the images by swapping image1.png with a different image, image2.png with a different image etc. Again these images reside in the 'images' folder. NOTE: All images must be PNG flies. This is the first file that the flash application looks for, and if it is a JPG or other file, it will not work. ********************************************* 2. Batch Files ********************************************* Each batch file must reside in the 'fscommand' folder in order for the flash executable to use it. These files are used to launch executables, and according to adobe's documentation this is where any executable that flash will be running needs to reside. A snippet on how to launch a batch file: fscommand("EXEC", batch.bat); A snippet on how to run executables from a batch file: @echo off start "" %~dp0\ONSCREEN\ONSCREEN.EXE @exit A snippet on how to terminate executable from a batch file: @echo off TASKKILL /F /IM "MYTSOFT2.exe" @exit NOTE: %~dp0 will get the folder that you are currently in. All executables should reside in the fscommand folder along with all the batch files. ********************************************* 3. XML Files ********************************************* The XML files are used to pass data to the action script code. Things such as the image path, the name for buttons, and which batch file to be executed are taken in by the flash projector. This is done by reading the XML file and storing them in variables in the action script. An example of one of the XML files used in the program: A snippet on how to get this data into the action script code: var images:XMLList; var loadersArray:Array[]; var xmlLoader:URLLoader = new URLLoader(); xmlLoader.addEventListener(IOErrorEvent.IO_ERROR, onIOError); xmlLoader.addEventListener(Event.COMPLETE,processXML); function onIOError():void { trace("IO ERROR"); //testing } function processXML(e:Event) { var speed:Number; var xmlLoader:XML = new XML(e.target.data); speed = xmlLoader.@SPEED; trace(speed); } NOTE: This example uses the XML file described above and stores the SPEED of the slide show in a variable called speed and uses the trace function to output the value taken in from the XML file. ********************************************* 4. Phidgets ********************************************* The Phidgets board allows turning on and off digital outputs in order to get robots or other external devices running which only require a power source and have code directly downloaded to them. It works as a switch to toggle the device or devices on or off. Visit www.Phidgets.com, which contains more information as well as the necessary downloads. You must use the web server for flash in order to bypass security settings for flash. The 'com' folder is where the action script files used by the phidget board reside. This can be read into more detail at www.Phidgets.com. Board Model: PhidgetInterfaceKit 0/16/16 import com.phidgets.*; import com.phidgets.events.*; var phid:PhidgetInterfaceKit; var state:bool; state = true; phid = new PhidgetInterfaceKit; phid.addEventListener(PhidgetEvent.ATTACH, onAttach); phid.open("serverName", 5001); funciton onAttach():void { phid.setOutputState(0,state); // this will turn on port 0 on, on the board. } Additionally you can change which port will be used by the action script and turned on... in the following port 2 is going to be turned on because 2 is being read in by the action script. port.xml: This is used incase a port goes 'bad', or if you want to add more ports to be turned on by the application. Example: You have two or more robots or devices you want to turn on with different ports. NOTE: The webservice must be running for the phidget.The "ServerName" can be set there as well as the port. By default it is 5001 for the model that I am using. Also sending the board true or false directly will result in an error in flash. ********************************************* 5. Launching Programs ********************************************* This section describes how to change which programs are launched by the program: appList.xml: