Passing variables between Flash and Rev
Henk van der Velden
henk at iglow-media.nl
Fri Jul 11 14:55:53 CDT 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
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
Flash\x20 5051 username 23u IPv4 0x03d71740 0t0 TCP
Rev also lists 51733 in opensockets. Why is that? Is that normal?
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
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.
Henk v.d. Velden
Magda Janssenslaan 36
3584 GR UTRECHT
0031 (0)6 16 024 337
More information about the use-livecode