Skip to content

Cant send data from Flash right after connect #13

@GoogleCodeExporter

Description

@GoogleCodeExporter
If you send data from Flash to TinkerProxy in the onConnect handler, then the 
data does not make it to the Arduino.

Im not sure if this is a Flash or TinkerProxy issue.

For example:

private function onConnect(event:Event):void
{
     _socket.writeByte(1);
}

Wont make it to the Arduino.

The workaround is the wait two seconds after connect before you send data.

private function onConnect( event:Event ):void
{
    trace( "onConnect" );

    if(!connectDelayTimer)
    {
        connectDelayTimer = new Timer(2000);
        connectDelayTimer.addEventListener(TimerEvent.TIMER, onConnectDelayTimer);
    }

    connectDelayTimer.start();

}

private function onConnectDelayTimer(event:TimerEvent):void
{
    trace("onConnectDelayTimer");
    connectDelayTimer.stop();
        _socket.writeByte(1);
}

Again, Im not sure if this is a Flash or TinkerProxy issue, but wanted to post 
it here in case it is a TinkerProxy issue, and in case anyone else runs into it.

Btw, I tested this in Adobe AIR, and not in the Flash Player in the browser.

Original issue reported on code.google.com by mikechambers on 1 Aug 2010 at 5:55

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions