RE: Passing variables between Flash and Rev

View: New views
10 Messages — Rating Filter:   Alert me  

Parent Message unknown RE: Passing variables between Flash and Rev

by Henk van der Velden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Good day all,

picking up an old discussion about Flash variables and Rev:

One of our apps has a Flash movie played through a player object.
Flash variables are read and set through Trevor's QTExternal.
However the latest releases of QuickTime player don't support Flash  
playback anymore, so we have to look for another solution.

So my question is how can I read and write Flash variables from  
within a Rev application?

The application is used on school networks. Children use the Flash  
movie to create characters and save them by saving a couple of  
variables. I used to save these variables in an XML file using  
QTExternal.

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



_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Passing variables between Flash and Rev

by Colin Holgate :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Could you pass the variables through the url that you load? Like:

htpp://www.somewhere.com/someflashthing.swf?avar=this&bvar=that

Flash receives those and do whatever it's supposed to do.


_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Passing variables between Flash and Rev

by Jim Ault :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 5/14/08 5:39 AM, "Henk van der Velden" <henk@...> wrote:

> Good day all,
>
> picking up an old discussion about Flash variables and Rev:
>
> One of our apps has a Flash movie played through a player object.
> Flash variables are read and set through Trevor's QTExternal.
> However the latest releases of QuickTime player don't support Flash
> playback anymore, so we have to look for another solution.
>
> So my question is how can I read and write Flash variables from
> within a Rev application?
>
> The application is used on school networks. Children use the Flash
> movie to create characters and save them by saving a couple of
> variables. I used to save these variables in an XML file using
> QTExternal.
Flash versions have different capabilities.
Early versions (MX  MX2004) could read files, send and receive packets from
servers, and listen for packets from servers (variable strings or XML
format) using GET or POST methods.

You should be able to save the XML file using any app, including Rev, as
long as the permissions are correct.  The Flash movie should be able to read
that file.

HTH

Jim Ault
Las Vegas


_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Passing variables between Flash and Rev

by Troy Rollins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On May 14, 2008, at 11:37 AM, Jim Ault wrote:

> Flash versions have different capabilities.
> Early versions (MX  MX2004) could read files, send and receive  
> packets from
> servers, and listen for packets from servers (variable strings or XML
> format) using GET or POST methods.


... and later versions can just use a local socket connection.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net


_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Parent Message unknown Re: Passing variables between Flash and Rev

by Henk van der Velden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

OK, thanks a lot.

>> Flash versions have different capabilities.
>> Early versions (MX MX2004) could read files, send and receive  
>> packets from
>> servers, and listen for packets from servers (variable strings or XML
>> format) using GET or POST methods.
>>
>
>
> ... and later versions can just use a local socket connection.


I'm new to the socket stuff. Can I ask a few questions about it?

1. So I can have a Flash file played through revBrowser in a Rev  
application, and have that Flash file communicate with the very same  
Rev application through a local socket connection?

2. A local socket, is that something like "127.0.0.0: port number"?

3. Does this approach require a specific setup of the computer?

4. Does this approach work in case of a proxy server being used on  
the local network?

5. And the last one, although it is Flash related it might be of  
interest to some more Rev developers: I need to use XMLSocket()?


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



_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Passing variables between Flash and Rev

by Dave Cragg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 19 May 2008, at 08:48, Henk van der Velden wrote:

> I'm new to the socket stuff. Can I ask a few questions about it?
>
> 1. So I can have a Flash file played through revBrowser in a Rev  
> application, and have that Flash file communicate with the very same  
> Rev application through a local socket connection?

Interesting idea. But I think you'll have to overcome Flash's security  
restrictions. If the Flash file is loaded from the web, by default it  
can't connect to any other domain, including the local domain.  
However, there is a way to get round this by using a cross-domain  
policy file. I've never tried this for XMLSocket(), but according to  
the docs it's doable. However, it's not clear whether that can be used  
for connections to localhost instead of other domains on the internet.  
Worth trying. There's some information here about implementing a  
socket policy file.

http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001952.html

>
>
> 2. A local socket, is that something like "127.0.0.0: port number"?

I think "localhost:portnum" will work.

Please let us know if you have any success.

Cheers
Dave
_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Passing variables between Flash and Rev

by Troy Rollins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On May 19, 2008, at 3:48 AM, Henk van der Velden wrote:

> 1. So I can have a Flash file played through revBrowser in a Rev  
> application, and have that Flash file communicate with the very same  
> Rev application through a local socket connection?

Right.

>
>
> 2. A local socket, is that something like "127.0.0.0: port number"?

Correct again.

>
>
> 3. Does this approach require a specific setup of the computer?

No. Though I can't say whether or not highly restrictive local  
firewalls, or anti-virus software may cause conflict, though I've done  
this process on my systems, and it has worked fine.

>
>
> 4. Does this approach work in case of a proxy server being used on  
> the local network?

I don't see why that should matter, since you aren't actually even  
actually leaving the local system, and the IP is strictly local to the  
machine.

>
>
> 5. And the last one, although it is Flash related it might be of  
> interest to some more Rev developers: I need to use XMLSocket()?

Sure, but the name is misleading, it is actually just a standard text  
connection.

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.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net


_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Parent Message unknown Re: Passing variables between Flash and Rev

by Henk van der Velden :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks a lot; I'll dive into this.
Henk

On 19-mei-2008, at 19:00, use-revolution-request@... wrote:

> 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.
>
> --
> Troy
> RPSystems, Ltd.
> http://www.rpsystems.net
>

_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Passing variables between Flash and Rev

by Dave Cragg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On 19 May 2008, at 19:11, Henk van der Velden wrote:

> Thanks a lot; I'll dive into this.
> Henk

I got intrigued, and managed to get something working. (It needs Flash  
Player 9.) You can try this in the Rev message box.

go url "http://www.lacscentre.co.uk/flex/socketTest/FlashSocketTest.rev"


When the stack loads, click the Setup button. It will load a swf file  
using revBrowser.

When the swf file has loaded, click its "Get Environment From Rev"  
button. Hopefully, it will display the environment variables and time  
supplied by Rev.

Troy wrote:

> 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?

Cheers
Dave
_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Re: Passing variables between Flash and Rev

by Troy Rollins-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On May 19, 2008, at 4:53 PM, Dave Cragg wrote:

> 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.

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net


_______________________________________________
use-revolution mailing list
use-revolution@...
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution