// I d like to pass a number (id) to the arduino attached to this computer // so this id could spread via XBee to another arduino which needs this number // to response with a string. // Dozo, See the code where HELP is NEEDED. package { import flash.utils.Timer; import flash.display.Sprite; import flash.events.Event; import funnel.*; public class FlashTest extends Sprite { private var arduino:Arduino; public function FlashTest() { // PASS THIS NUMBER VIA XBee (the XBee part is working ok) var id:uint = 11; //could be any number... //PASS THE NUMBER AT EACH SECOND (LOOPING) var intervalo:Timer = new Timer(1000); intervalo.start(); intervalo.addEventListener(TimerEvent.TIMER,sendID); // ???? HELP IS NEEDED HERE function sendID(e:Event):void{ // I mean arduino to keep sending this ID number to serial as if I had programed: // void loop(){ // Serial.print(id) // } // in Arduino itself. arduino.sendString(id); //<----------------- this is invention //call the function to retrive the string from serial getString(); } // ???? HELP IS NEEDED HERE // arduino will receive strings from serial after succefully send an ID number to serial // it is a string like this: "12,14,102332," function getString():void{ var response:String = arduino.serialRead(); //<----------------- this is invention // ...and trace it; trace(response); //it should trace ("12,14,102332") each time there is available data at serial; //I dont even know if firmata is really needed since all I want is to retrive strings from serial to flash. } } } } HOW TO SEND / RECEIVE STRINGS between FLASH AND ARDUINO ?