So you might have been looking around on various websites downloading the code for Arduino to communicate with flash, But if you're like me you probably had some trouble trying to get them to properly communicate.  Well this tutorial will show you how-to setup the Arduino with flash. 

Step 1: Download the Proper Files

In this tutorial I'm going to assume that you already have used the arduino before so I will not go over the basic setup. Below is a link to a program that will provide a server for the arduino and flash to communicate between.
This Link is provided by Kasper Kamperman.

Once you have downloaded these files extract them to a safe place where you will not delete them.

Step 2: Uploading the Arduino Program

Just upload the Example>Firmata>StandardFirmata to your arduino. And that is all you will have to use the arduino for on the software side. You will still need to plug in the required hardware to do what you wish.

Step 3: Configuring Your Serproxy

Now let's go to where you extracted the files from the zip archive.  Let's open serproxy.cfg (in a text editor of your choice) and configure according to the following instructions.  Below Is my configuration for Windows Vista with the Arduino on COM3. 

# Config file for serproxy
# Original documentation not included you can download the original package at
# http://www.arduino.cc/en/Main/Software
# Change the settings below for your configuration

# Transform newlines coming from the serial port into nils
# if using Flash AS2 or AS1 : true
# if using Flash AS3 : false


# Same number as in Serial.begin() in the Arduino code
# With StandardFirmata try 57600 or (older Arduino versions) 115200


# Idle time out in seconds


# Different configuration for Mac and Windows
# Change the settings and make sure you comment everything
# of the OS you don't use.

# Windows :
# Choose the COMport where Arduino is connected
# You can find this in the Arduino IDE Tool - Serialport
# Change the net_port number in the same number as the serialport number at the "comm_ports" line
# example : if comm_ports=3 -> net_port3=5331
# decomment below................


# osx :
# You can find the serial_device name in the Arduino IDE Tool - Serialport
# change the part marked with $ in the number of your device
# for example : serial_device1=/dev/cu.usbserial-A6008rZN



Step 4: Working on the FLA

Use your version of Flash to open up the FLA for as3Glue_program_example  Then start up Serproxy and press CTRL + Enter to Run the flash project.  It will Bring Up diagnostics once It has detected Your Arduino, If this does not happen try to access your arduino by Restarting it.

Step 5: Making Your Light on Pin 13 Turn On/off

To make your LED toggle on click just add the following lines to your code.

function myClick(eventObject:MouseEvent) {
trace("mouse click detected");

^ Add This towards the top of the code

function clicklight(){
trace("Button Clicked");
 lighton = false
 lighton = true

^ Add this toward the bottom of the code
I am sorta new to Arduino.. (just hobby playing..etc)<br>but am a decent Flash developer (AS2 at least) ;)<br><br>I was under the impression this only worked with AS3?<br><br>but these comments confuse me.. can you elaborate?<br><br># Transform newlines coming from the serial port into nils<br># if using Flash AS2 or AS1 : true<br># if using Flash AS3 : false<br><br>Thanks
I found this code on a site where it was listed as how to do it in AS3 so I am not completely sure.

About This Instructable




More by acksheep13:Integrating your Arduino With Flash and Actionscript 3 Wax tutorial Chroma-Key and Snow effects! How to Humainly Medicate your Cat 
Add instructable to: