Passing variables between Flash and Rev
Henk van der Velden
henk at iglow-media.nl
Mon Jul 14 11:00:01 EDT 2008
>> 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 believe that when I've done this in the past, I've just polled
> the socket for data.
Hello Dave, Troy, and others,
if I may ask another question about this one:
Just polling the socket for data, does that mean doing a 'read from
socket' say every second?
Dave's solution is to close the socket every time. But that means you
can't keep the connection to the Flash movie open, isn't it? I hoped
I could open a Flash movie, set the initial variable values of it by
sending them from Rev, and read these variables from the Flash movie
before leaving the Rev card.
Something like this:
1. open Flash movie, Flash movie connects to socket, Rev writes
values to socket, Flash movie reads them and uses them to
'initialise' movie
2. user changes all sorts of values by clicking, dragging etc in
Flash movie
3. when user clicks a Save button (in Rev), Rev writes
"returnVariables" or something to socket, Flash reads it and then
writes the variable values back to the socket. Rev reads them and
saves them to a file.
Kind regards,
Henk
--------------------------
Henk v.d. Velden
iGlow Media
Magda Janssenslaan 36
3584 GR UTRECHT
Netherlands
0031 (0)6 16 024 337
www.iglow-media.nl
More information about the use-livecode
mailing list