Passing variables between Flash and Rev

Henk van der Velden henk at
Fri Jul 11 15:55:53 EDT 2008

> > In the end, it works like this... you have Rev start listening for a
> > socket connection, you have Flash connect to it, and you start
> > communicating back and forth.
> I had trouble working out how to manage the connection from the Rev
> side. If you want Rev to push data to the Flash element at arbitrary
> times, you need to keep the connection open. But if you also want to
> accept data from the Flash element, doesn't the Flash script need to
> reset the connection prior to sending data otherwise Rev doesn't know
> when to read from the socket. In the example above, Rev closes the
> socket each time after sending the data, forcing the Flash component
> to reconnect. Is there a cleaner approach to this?

I'm trying to build something like this, but I run into some issues I  
don't understand.

The setup:
A Rev app opening a socket connection 1987, starts listening at it.
A flash movie displayed within a Rev window by revBrowser.
Flash movie connects to the socket.

First strange thing:
when I open socket 1987 in Rev, and then have the Flash app connect  
to it, a second socket is opened. From Terminal lsof -i -P:

Flash\x20 5051 username   13u  IPv4 0x03d6594c      0t0  TCP *:1987  
Flash\x20 5051 username   22u  IPv4 0x03d64200      0t0  TCP  
localhost:51733->localhost:1987 (ESTABLISHED)
Flash\x20 5051 username   23u  IPv4 0x03d71740      0t0  TCP  
localhost:1987->localhost:51733 (ESTABLISHED)

Rev also lists 51733 in opensockets. Why is that? Is that normal?

Second issue:
Then I start sending from Flash to Rev by clicking a button in Flash  
movie. First time everything is OK: message is received by Rev. Then  
I try to send a second time, but nothing is received by Rev. How can  
that be?

Third issue:
when clicking on a Flash button to write to a socket, I need to click  
outside the browser image before I can click that button again.

Kind regards,

Henk v.d. Velden
iGlow Media
Magda Janssenslaan 36

0031 (0)6 16 024 337

More information about the use-livecode mailing list