3
votes

If swf file is embedded in html it is easy to call ActionScript methods via ExternalInterface using JavaScript. Now I want to use the swf file outside of a browser and still be able to access its methods, but now I want to use Python to call ActionScript. Is it possible? There is so little information about it in the Internet. Probably I can use AMF (pyAmf) for this, can I?

Thanks in advance.

2

2 Answers

1
votes

If you want to use the swf in such a manner outside the browser investigate AIR or localconnection.

[Edit] You can use Python to listen for ExternalInterface events. osflash.org has something you could look into, albeit a little outdate:

http://osflash.org/ext_howto

or some example Python:

def ExternalCall(self,evt):
    print "ExternalCall", evt.request
    ret = "<object><property><string>Sample data</string></property></object>"
    self.movie.SetReturnValue(ret)
0
votes

Your swf can listen for connections with Socket, acting like a server. ByteArray.readObject can read object in AMF format from message bytes, so you can encode method name and arguments in object.