views:

502

answers:

2

I'd like to contact an FMS server through a script and download the persistent Remote SharedObject.

The Flash program connects to the FMS server, opens a NetConnection, makes a SharedObject.getRemote call. I'd like to access this info through PHP, Ruby, Perl, etc to work with in a script.

I understand this info is sent to the Flash player as an AMF object, over the RTMP protocol. Since it's RTMP and not HTTP, I can't use a SabreAMF client for instance, as it uses cURL, which does not support RTMP.

Anyone have any ideas about how to do this?

+1  A: 

Sorry, no experience with SabreAMF, so what I'm about to say won't help much.

Can't you use a swf as a proxy/bridge from SabreAMF to Ruby ? get the remote object from the swf and when you've got the data, pass it on to your preferred server language ( Ruby, etc. ) ?

George Profenza
Thanks for your ponderings. I'd like to do just that, but I found the Sabre client uses curl, which doesn't support RTMP. If it did, I could get the AMF object and it would make it into a PHP object for me or whatever.
Alex JL
No problem. To be I couldn't give you a solution, should I delete my answer ?
George Profenza
I think you're on the right track there, and I didn't quite get it at first! I've never made an SWF but that could be the key here.
Alex JL
+1  A: 

A SharedObject is essentially just a key/value collection. All you have to do is make the call through Flash, listen for the update event, iterate through all properties of the SharedObject and write them into an object of your own - a Dictionary or just Object type. You can then send this to your Sabre AMF Gateway as whatever type PHP uses for this.

Johan Öbrink
Thanks, I do think the easiest way might be to write my own SWF that connects and downloads the Shared Object, and puts it in a form that I can work with from PHP. I was hoping to have something that does this within a script, though - can you run SWFs from a command line?
Alex JL
Not to my knowledge. If you want something that runs continously, you colud build an AIR app that does the job for you. There is allso the possibility of setting up a Red5 Server but then you will have to do your coding in Java.If you use AIR, I suggest you build it in Flex and use the memory profiler to avoid memory leaks that lead to crashes. Read more about AIR and memory @ http://allyourbase-tech.blogspot.com/2008/08/air-garbage-collection-and-memory-leaks.html
Johan Öbrink