Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant send data from Flash right after connect #13

Open
GoogleCodeExporter opened this issue Apr 17, 2016 · 2 comments
Open

Cant send data from Flash right after connect #13

GoogleCodeExporter opened this issue Apr 17, 2016 · 2 comments

Comments

@GoogleCodeExporter
Copy link

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

@GoogleCodeExporter
Copy link
Author

Just to add one note, I tried setting the delay to less than two seconds, but 
it wouldnt work with anything less than 2 seconds.

Original comment by mikechambers on 1 Aug 2010 at 5:56

@GoogleCodeExporter
Copy link
Author

I spoke with the player team about this, and this is a Flash Player issue, and 
not tinkerproxy. You can close this.

Original comment by mikechambers on 2 Aug 2010 at 5:59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant