DIY Magic Mirror Source Code Setup Instructions
  Get Source Code Here from GitHub
   
  * The DIY Magic Mirror is written in Adobe Flash Action Script 3.0
  * Adobe AIR is used which enables the DIY Magic Mirror to run on the PC, Mac, and Linux.
  * All external Action Script libraries are provided including AS3Glue which enables Arduino communication to Flash and picasaflashapi which enables the DIY Magic Mirror to stream Picasa Web Albums.
  * If you do modify the source code and feel it will benefit the community, please do send it in to us and we'll do our best to include in a future release.
  * The program is currently 3,000+ lines of code.
  * Here's some key pieces of the source code, it will give you a feel for how its coded and what you would need to understand in order to modify for your own use
  * You'll need a copy of Adobe Flash Professional CS5 or higher to open and modify the source code (.FLA file and action script file).
 
  Source Code Files
 
  mirror.fla - Flash File for Magic Mirror Main Program
  mirror.as - ActionScript 3.0 File for Magic Mirror Main Program
  configure.fla - Flash File for the Configuration Program
  configure.as - ActionScript 3.0 File for the Configuration Program
  diymagicmirror.p12 - certficiate you can use for the Adobe AIR build - the password is < mirror > in lowercase.
  \sounds - various mp3 sound files used by the program, you can replace these with your own mp3's but you must use the same filename
  \images - images used by the program, do not modify these files
  \mac - files needed if your installation is on the Mac
  \linux - files needed if your installation is on Linux
  \Firmata2 - the program that needs to be uploaded to the Magic Mirror Sensor Hub/Arduino
 
  Source Code Action Script 3.0 Libraries
 
  \net - Enables the Arduino to talk to Flash via serproxy
  \sk - Streaming pics from Picasa
  MJPEG.as - Streaming video from an IP camera
  \mx - used for formatting
  \ascb - used for formatting and drawing
  \com - used for formatting
 
  Software Source Code Instructions
 
  1. First install the DIY Magic Mirror software from http://diymagicmirror.com/install.html
  2. Unzip the source code zip file to any directory on your computer.
  3. From Adobe Flash CS5 or higher, open the file < configure.fla >.
 

4. From the Flash CS5 menu, choose < File > and < Publish Settings > and then click the folder below and navigate to your source code directory.

After selecting the directory, click < Save >.

Click < OK >.

 

  5. From Adobe Flash CS5, open the file < mirror.fla > and repeat step 4 but save to the filename of < mirror > instead of < configure >.
 

6. From the Adobe Flash CS5 menu, click < File > and < AIR Settings > and click the < Select Icon Images > button.

Click the folder icon next to the 128 x 128 row.

Navigate to your source code directory and choose the < icons > directory.

Pick the corresponding icon and click < Open >.

Repeat for the other 3 icons and then click < OK > when done.

For the Digital signature, click < Change >.

Select your own certificate or you can use < diymagicmirror.p12 >.

The password is < mirror > in lowercase if using < diymagicmirror.p12 >.

 

 

7. Repeat step 6 for the file < mirror.fla >.

   
 

8. Launch the file C:\Program Files\DIY Magic Mirror\serproxy.exe or C:\Program Files\DIY Magic Mirror (x86)\serproxy.exe if your Windows OS is 64-bit. This must be running before you run the file < mirror.fla>.

   
 

9. From Adobe Flash CS5, open the file < configure.fla > and choose < Control > and < Test Movie > from the Adobe Flash CS5 main menu. If you don't have an Internet connection, you will get some errors which can ignore. You'll then see the configuration screen below and also the directory and file < diymagicmirror-settings\mirrorconfig.xml> > will be created in your "My Documents" directory. Next plug in your Magic Mirror Sensor Hub/Arduino and choose the correct dropdown port for the < Magic Mirror Sensor Hub Port > field and then < Save >.

 

10. From Adobe Flash CS5, open the file < mirror.fla > and choose < File > and < AIR Settings >. Select and delete the 5 directories below using the minus button and then add them all back using the folder icon with the plus button pointing them to the directory in your source code file location.

   
 

11. From the Adobe Flash CS5 menu with < mirror.fla > open, choose < Control > and < Test Movie >. If your Magic Mirror Sensor Hub/Arduino is plugged in and the correct port is set, you'll get:

If the Magic Mirror Sensor Hub is not plugged in or the wrong port is set, you'll get:

   
  12. Assuming everything ran correctly, you can now make your changes to the files < configure.as > and < mirror.as >.
  13. After you've made your changes and are ready to build your AIR install file, you can use the certificate < diymagicmirror.p12 > with the password of < mirror > in lowercase.
 
 
 
 

 

The DIY Magic Mirror hardware and software is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Home | Hardware | Software | Contact Us