Can I decode the AMF individually in AS2?

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

Can I decode the AMF individually in AS2?

by Iap-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
 
We have a flash movie (swf) which uses the XMLSocket and the JSON to communicate with a Twisted-based TCP server.
We realized that the ActionScript-JSON is the bottleneck in the communication.
The time consumed by decoding the JSON data in AS2 increases exponentially.
We consider to replace the JSON with AMF0.
This is where the pyAMF comes into play. 
 
We found an excellent example of Twisted-based solution to utilize the pyAMF in the server side.
But can not figure out how to adapt the client/swf side.
In our case, the client side connects the server by XMLSocket , not by http.
 
We have tested that XMLSocket can receive binary AMF0 data (encoded by pyAMF).
We need a encoder/decoder-only class in AS2.
In AS3, the decoding and encoding seems to be handled by the flash.net.Socket (with read/writeObject()) internally,
My question is that, in AS2, who handles the encoding and decoding of the AMF0 data?
 
Thanks in advance.
 
Iap

_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Can I decode the AMF individually in AS2?

by lists-144 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi lap,

in Actionscript 1 and 2 the Flash Remoting components are responsible for AMF encoding/decoding afaik.

You can grab them from this page [1] and the source is included. If you want to use them with Flash CS3 (or newer) check out this page [2].

I didn't know you could send raw AMF0 data using XMLSocket, cool to know.

hth,

Thijs


On 13 May 2009, at 05:00, Iap wrote:

Hi,
 
We have a flash movie (swf) which uses the XMLSocket and the JSON to communicate with a Twisted-based TCP server.
We realized that the ActionScript-JSON is the bottleneck in the communication.
The time consumed by decoding the JSON data in AS2 increases exponentially.
We consider to replace the JSON with AMF0.
This is where the pyAMF comes into play. 
 
We found an excellent example of Twisted-based solution to utilize the pyAMF in the server side.
But can not figure out how to adapt the client/swf side.
In our case, the client side connects the server by XMLSocket , not by http.
 
We have tested that XMLSocket can receive binary AMF0 data (encoded by pyAMF).
We need a encoder/decoder-only class in AS2.
In AS3, the decoding and encoding seems to be handled by the flash.net.Socket (with read/writeObject()) internally,
My question is that, in AS2, who handles the encoding and decoding of the AMF0 data?
 
Thanks in advance.
 
Iap
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment

Re: Can I decode the AMF individually in AS2?

by Iap-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Thijs
Thanks for your kindly response.
I have to confess that I have downloaded the "remote" component.
Maybe I am too stupid to find anything that I am looking for.
I tried to grep some keywords like "amf","deserialize" and study those scripts.
But still can not figure out how to do.
Any hint is appreciated.
 
Regards,
iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi lap,

in Actionscript 1 and 2 the Flash Remoting components are responsible for AMF encoding/decoding afaik.

You can grab them from this page [1] and the source is included. If you want to use them with Flash CS3 (or newer) check out this page [2].

I didn't know you could send raw AMF0 data using XMLSocket, cool to know.

hth,

Thijs


On 13 May 2009, at 05:00, Iap wrote:

Hi,
 
We have a flash movie (swf) which uses the XMLSocket and the JSON to communicate with a Twisted-based TCP server.
We realized that the ActionScript-JSON is the bottleneck in the communication.
The time consumed by decoding the JSON data in AS2 increases exponentially.
We consider to replace the JSON with AMF0.
This is where the pyAMF comes into play. 
 
We found an excellent example of Twisted-based solution to utilize the pyAMF in the server side.
But can not figure out how to adapt the client/swf side.
In our case, the client side connects the server by XMLSocket , not by http.
 
We have tested that XMLSocket can receive binary AMF0 data (encoded by pyAMF).
We need a encoder/decoder-only class in AS2.
In AS3, the decoding and encoding seems to be handled by the flash.net.Socket (with read/writeObject()) internally,
My question is that, in AS2, who handles the encoding and decoding of the AMF0 data?
 
Thanks in advance.
 
Iap
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

Re: Can I decode the AMF individually in AS2?

by lists-144 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi iap,

could you paste your Twisted and XMLSocket AS2 code here so I can give it a try myself? Because it also might be a nice example..

Cheers,

Thijs

On 14 May 2009, at 06:04, Iap wrote:

Hi, Thijs
Thanks for your kindly response.
I have to confess that I have downloaded the "remote" component.
Maybe I am too stupid to find anything that I am looking for.
I tried to grep some keywords like "amf","deserialize" and study those scripts.
But still can not figure out how to do.
Any hint is appreciated.
 
Regards,
iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi lap,

in Actionscript 1 and 2 the Flash Remoting components are responsible for AMF encoding/decoding afaik.

You can grab them from this page [1] and the source is included. If you want to use them with Flash CS3 (or newer) check out this page [2].

I didn't know you could send raw AMF0 data using XMLSocket, cool to know.

hth,

Thijs


On 13 May 2009, at 05:00, Iap wrote:

Hi,
 
We have a flash movie (swf) which uses the XMLSocket and the JSON to communicate with a Twisted-based TCP server.
We realized that the ActionScript-JSON is the bottleneck in the communication.
The time consumed by decoding the JSON data in AS2 increases exponentially.
We consider to replace the JSON with AMF0.
This is where the pyAMF comes into play. 
 
We found an excellent example of Twisted-based solution to utilize the pyAMF in the server side.
But can not figure out how to adapt the client/swf side.
In our case, the client side connects the server by XMLSocket , not by http.
 
We have tested that XMLSocket can receive binary AMF0 data (encoded by pyAMF).
We need a encoder/decoder-only class in AS2.
In AS3, the decoding and encoding seems to be handled by the flash.net.Socket (with read/writeObject()) internally,
My question is that, in AS2, who handles the encoding and decoding of the AMF0 data?
 
Thanks in advance.
 
Iap
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment

Re: Can I decode the AMF individually in AS2?

by Iap-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Thijs,
You got me. It is a mistake to say that XMLSocket accepts binary data.
Well, the workaround is to encode the binary to base64.
(If it is worthy when base64 is introduced? that is another question)
 
test_amf_server.py : the server
test_amf.fla: the AS2 fla
test_amf.as: required by the test_amf.fla
Base64.as: the base64 encoder/decoder
 
Jnjoy.
 
Iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi iap,

could you paste your Twisted and XMLSocket AS2 code here so I can give it a try myself? Because it also might be a nice example..

Cheers,

Thijs

On 14 May 2009, at 06:04, Iap wrote:

Hi, Thijs
Thanks for your kindly response.
I have to confess that I have downloaded the "remote" component.
Maybe I am too stupid to find anything that I am looking for.
I tried to grep some keywords like "amf","deserialize" and study those scripts.
But still can not figure out how to do.
Any hint is appreciated.
 
Regards,
iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi lap,

in Actionscript 1 and 2 the Flash Remoting components are responsible for AMF encoding/decoding afaik.

You can grab them from this page [1] and the source is included. If you want to use them with Flash CS3 (or newer) check out this page [2].

I didn't know you could send raw AMF0 data using XMLSocket, cool to know.

hth,

Thijs


On 13 May 2009, at 05:00, Iap wrote:

Hi,
 
We have a flash movie (swf) which uses the XMLSocket and the JSON to communicate with a Twisted-based TCP server.
We realized that the ActionScript-JSON is the bottleneck in the communication.
The time consumed by decoding the JSON data in AS2 increases exponentially.
We consider to replace the JSON with AMF0.
This is where the pyAMF comes into play. 
 
We found an excellent example of Twisted-based solution to utilize the pyAMF in the server side.
But can not figure out how to adapt the client/swf side.
In our case, the client side connects the server by XMLSocket , not by http.
 
We have tested that XMLSocket can receive binary AMF0 data (encoded by pyAMF).
We need a encoder/decoder-only class in AS2.
In AS3, the decoding and encoding seems to be handled by the flash.net.Socket (with read/writeObject()) internally,
My question is that, in AS2, who handles the encoding and decoding of the AMF0 data?
 
Thanks in advance.
 
Iap
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users







_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

test_amf_server.py (2K) Download Attachment
test_amf.fla (359K) Download Attachment
Base64.as (9K) Download Attachment
test_amf.as (1K) Download Attachment

Re: Can I decode the AMF individually in AS2?

by lists-144 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Iap,

I tested your app and it seems to work properly, cool stuff. I'm not sure if we should introduce base64 in the library, but I think it would be nice to have this example in our repository so we can point it out to people that might need similar functionality. What do you think?

Cheers,

Thijs

On 15 May 2009, at 08:29, Iap wrote:

Hi Thijs,
You got me. It is a mistake to say that XMLSocket accepts binary data.
Well, the workaround is to encode the binary to base64.
(If it is worthy when base64 is introduced? that is another question)
 
test_amf_server.py : the server
test_amf.fla: the AS2 fla
test_amf.as: required by the test_amf.fla
Base64.as: the base64 encoder/decoder
 
Jnjoy.
 
Iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi iap,

could you paste your Twisted and XMLSocket AS2 code here so I can give it a try myself? Because it also might be a nice example..

Cheers,

Thijs

On 14 May 2009, at 06:04, Iap wrote:

Hi, Thijs
Thanks for your kindly response.
I have to confess that I have downloaded the "remote" component.
Maybe I am too stupid to find anything that I am looking for.
I tried to grep some keywords like "amf","deserialize" and study those scripts.
But still can not figure out how to do.
Any hint is appreciated.
 
Regards,
iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi lap,

in Actionscript 1 and 2 the Flash Remoting components are responsible for AMF encoding/decoding afaik.

You can grab them from this page [1] and the source is included. If you want to use them with Flash CS3 (or newer) check out this page [2].

I didn't know you could send raw AMF0 data using XMLSocket, cool to know.

hth,

Thijs


On 13 May 2009, at 05:00, Iap wrote:

Hi,
 
We have a flash movie (swf) which uses the XMLSocket and the JSON to communicate with a Twisted-based TCP server.
We realized that the ActionScript-JSON is the bottleneck in the communication.
The time consumed by decoding the JSON data in AS2 increases exponentially.
We consider to replace the JSON with AMF0.
This is where the pyAMF comes into play. 
 
We found an excellent example of Twisted-based solution to utilize the pyAMF in the server side.
But can not figure out how to adapt the client/swf side.
In our case, the client side connects the server by XMLSocket , not by http.
 
We have tested that XMLSocket can receive binary AMF0 data (encoded by pyAMF).
We need a encoder/decoder-only class in AS2.
In AS3, the decoding and encoding seems to be handled by the flash.net.Socket (with read/writeObject()) internally,
My question is that, in AS2, who handles the encoding and decoding of the AMF0 data?
 
Thanks in advance.
 
Iap
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


<test_amf_server.py><test_amf.fla><Base64.as><test_amf.as>_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users

PGP.sig (201 bytes) Download Attachment

Re: Can I decode the AMF individually in AS2?

by Iap-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi, Thijs,
Sure. No problem. You have all right to do and modify to whatever you want.
But it is not completed. Since the client side (swf) does not decode the received data.
 
Iap

2009/5/20 Thijs Triemstra | Collab <lists@...>
Hi Iap,

I tested your app and it seems to work properly, cool stuff. I'm not sure if we should introduce base64 in the library, but I think it would be nice to have this example in our repository so we can point it out to people that might need similar functionality. What do you think?

Cheers,

Thijs

On 15 May 2009, at 08:29, Iap wrote:

Hi Thijs,
You got me. It is a mistake to say that XMLSocket accepts binary data.
Well, the workaround is to encode the binary to base64.
(If it is worthy when base64 is introduced? that is another question)
 
test_amf_server.py : the server
test_amf.fla: the AS2 fla
test_amf.as: required by the test_amf.fla
Base64.as: the base64 encoder/decoder
 
Jnjoy.
 
Iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi iap,

could you paste your Twisted and XMLSocket AS2 code here so I can give it a try myself? Because it also might be a nice example..

Cheers,

Thijs

On 14 May 2009, at 06:04, Iap wrote:

Hi, Thijs
Thanks for your kindly response.
I have to confess that I have downloaded the "remote" component.
Maybe I am too stupid to find anything that I am looking for.
I tried to grep some keywords like "amf","deserialize" and study those scripts.
But still can not figure out how to do.
Any hint is appreciated.
 
Regards,
iap

2009/5/14 Thijs Triemstra | Collab <lists@...>
Hi lap,

in Actionscript 1 and 2 the Flash Remoting components are responsible for AMF encoding/decoding afaik.

You can grab them from this page [1] and the source is included. If you want to use them with Flash CS3 (or newer) check out this page [2].

I didn't know you could send raw AMF0 data using XMLSocket, cool to know.

hth,

Thijs


On 13 May 2009, at 05:00, Iap wrote:

Hi,
 
We have a flash movie (swf) which uses the XMLSocket and the JSON to communicate with a Twisted-based TCP server.
We realized that the ActionScript-JSON is the bottleneck in the communication.
The time consumed by decoding the JSON data in AS2 increases exponentially.
We consider to replace the JSON with AMF0.
This is where the pyAMF comes into play. 
 
We found an excellent example of Twisted-based solution to utilize the pyAMF in the server side.
But can not figure out how to adapt the client/swf side.
In our case, the client side connects the server by XMLSocket , not by http.
 
We have tested that XMLSocket can receive binary AMF0 data (encoded by pyAMF).
We need a encoder/decoder-only class in AS2.
In AS3, the decoding and encoding seems to be handled by the flash.net.Socket (with read/writeObject()) internally,
My question is that, in AS2, who handles the encoding and decoding of the AMF0 data?
 
Thanks in advance.
 
Iap
_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users


<test_amf_server.py><test_amf.fla><Base64.as><test_amf.as>_______________________________________________


_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users



_______________________________________________
PyAMF users mailing list - users@...
http://lists.pyamf.org/mailman/listinfo/users