Flash/QuickTime interaction with Revolution
Trevor DeVore
lists at mangomultimedia.com
Thu Sep 16 12:42:11 EDT 2004
On Sep 16, 2004, at 9:00 AM, Scott Rossi wrote:
>
> (BTW, many months ago, some kind soul on the list sent me a file that
> demonstrates communication between Flash and Rev using sockets. For
> the
> life of me, I can't find the sample nor do I recall the person who
> sent the
> example so if this person is reading now, perhaps you can step out of
> the
> shadows and reveal yourself? :-)
It wasn't me who posted originally but I did play around with the
concept after reading that post. This is the code I have in the
concept stack I made based on the post. If I remember correctly I was
using this with the Flash XML object using sockets.
=====
== BUTTON SCRIPT WHICH OPENS THE SOCKET FOR XML COMMUNICATION WITH FLASH
== NAMED "startXML"
=====
on mouseUp
put empty into fld "results"
accept connections on port 7979 with message "wFlashSocket"
end mouseUp
on wFlashSocket pSocket
# Store socket for further use
set the uFlashSocket of me to pSocket
put "request received"
set itemDelimiter to "$"
set socketTimeoutInterval to 100
read from socket pSocket for 1 line
put item 2 of it & pSocket into field "results"
write "hi" & return & null to socket pSocket
end wFlashSocket
=====
== BUTTON SCRIPT THAT SENDS A MESSAGE TO FLASH THROUGH AN OPEN SOCKET
=====
on mouseUp
write "<element>Hi Flash</element>" & null to socket the uFlashSocket
of button "startXML"
end mouseUp
--
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com
More information about the use-livecode
mailing list