tags:

views:

25

answers:

1

Either of these options would be fabulous:

  1. Send a bitmap image of the stage's current look to the server.
  2. Send the id and x,y coordinates of the objects on the stage to the server.

Is there a way to do this?

+1  A: 

You can do either fairly easily.

Since you didn't specify which version of ActionScript I'll describe the ideas since they will work slightly differently between AS2 and AS3.

For the first, you'll create a BitmapData object (specifying the dimensions of the stage) and then you'll use it's draw method to capture the stage. Then you just have to encode it to send the bitmap to the server - there are many image encoders (PNG, JPG, etc) out there.

For the second, you just need to loop over the assets. In AS2 you just need a for...in loop. For AS3 you'll loop over the display list by getting the total number of objects on the stage and then using the getChildAt method to get each object and capture it's coordinates.

Branden Hall