0

I'm working on an application that would allow users to create a custom character sheet for role play games. I have most of the code figured out, but I want users to be able to send their character sheets between devices.

So here's the question: is there a way to save and send a shared object file, or a way to create a txt file that can easily be saved and copied?

  • Please elaborate your question more. Show us the code you have achieved and what you have tried?, what are these devices? what is the method of communication? There needs to be so much more information in your question. Please provide more details to enable SO users to help you. – Gurtej Singh Aug 28 '15 at 04:46
  • Question unclear and there is no code, so answer the same. The is way to send SO over net via AMF format, or just as text in JSON – Dmitry Malugin Aug 28 '15 at 07:12

2 Answers2

0

I don't believe you can send a SharedObject from one device to another, at least without a lot of work. You could however create an XML file containing the data and save that up to a server. You could allow the user to then download character sheets from your server and the app would read the XML data before converting to a SharedObject. Can't really provide any code for this as the details are lacking.

AntBirch
  • 272
  • 4
  • 20
0

If I understand you correctly, you could sort of do this.

You cannot literally "send and receive" a SharedObject (well, you might be able to copy your shared object data on the file system directly, but not from Flash).

What you can do is provide options to the user to save and load a file that encodes all the shared data in AMF bytes. Here's the general idea:

  • First you need to give the user an option to save their data. You can use ByteArray/writeObject() to write your data using the same AMF format that SharedObjectuses, and FileReference/save() to allow the user to save it to a file on their file-system.

  • Next, you can use FileReference/load() to load the file and ByteArray/readObject() to read all the data into AS3. Now you can simply store it in the SharedObject however you want, just like you did before.

Aaron Beall
  • 49,769
  • 26
  • 85
  • 103