1

I'm producing a Flash tutorial project in Flash Professional CS5 using the ActionScript3 programming language, with my SWF optimised for Flash Player 10 (or higher).

My question relates to whether it is possible to write a Mouse Click function in AS3, attached to a button, which when clicked exports numerical/string data held within an array in Flash into a new suitable file format (such as CSV/XML), which my user can then subsequently open, view and edit in Microsoft Excel? This data wouldn't need to be passed back to Flash at any stage.

My tutorial is likely to be embedded within a web page or framework rather than sitting on the desktop. Can Flash conceivably 'package up' array held data and produce new file types? From reading around the CSV and XML file formats look my best options if the user is to study the data exported from Flash within the Excel software package?

If I'm embedding the project on the web, is there any PHP additionally required, which could aid in this re-packaging process and post the CSV or XML to a file location on the server or even better the user's hard-drive? Can Flash 'talk' directly with Microsoft Excel and do a conversion, export and open, or at best would the user be able to just get hold of the CSV/XML text file and open the file themselves manually in Excel?

A number of questions I know, but if any developer who has encountered (and hopefully conquered) this type of problem could provide me with some guidance or even better some example AS3 code which tackles this issue, I'd be extremely grateful.

Kind Regards,

Joel

Joel
  • 247
  • 5
  • 15

2 Answers2

0

try this solution Writing to CSV file in AS3 - simple as3 code or csvlib on google code.

Community
  • 1
  • 1
fsbmain
  • 5,267
  • 2
  • 16
  • 23
0

I will post an example of this later:

  1. Create a PHP page to output to Excel
  2. Post the data to the PHP page (use JSON for ease of use)
  3. Parse data on PHP side to generate adequate Array structure
  4. Output the Excel sheet from PHP

Export Excel from PHP:

1) http://code.google.com/p/php-excel/

2) Alternative for PHP_excel

3) http://forums.digitalpoint.com/showthread.php?t=60681

Community
  • 1
  • 1
Reshape Media
  • 341
  • 3
  • 11