{"id":13744674,"url":"https://github.com/chamberlainpi/AIRFileSave","last_synced_at":"2025-05-09T03:33:05.147Z","repository":{"id":18084504,"uuid":"21148864","full_name":"chamberlainpi/AIRFileSave","owner":"chamberlainpi","description":"Ever wanted to dynamically write local files from a Flash game/app at runtime (without server-side scripts, or annoying File Dialog prompts)? This handy AIR app can serve as a 3rd-arm for your Flash projects that needs to dynamically update JSON, TXT, or even ByteArray files. Also useful for launching NativeProcess (batch, commands, etc.)","archived":false,"fork":false,"pushed_at":"2014-08-15T19:15:12.000Z","size":376,"stargazers_count":13,"open_issues_count":1,"forks_count":6,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-12-21T23:33:50.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"ActionScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"cuvva/cuvva-log-node","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chamberlainpi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-24T01:58:59.000Z","updated_at":"2023-07-25T13:52:17.000Z","dependencies_parsed_at":"2022-09-24T18:12:51.278Z","dependency_job_id":null,"html_url":"https://github.com/chamberlainpi/AIRFileSave","commit_stats":null,"previous_names":["bigp/airfilesave"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamberlainpi%2FAIRFileSave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamberlainpi%2FAIRFileSave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamberlainpi%2FAIRFileSave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamberlainpi%2FAIRFileSave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chamberlainpi","download_url":"https://codeload.github.com/chamberlainpi/AIRFileSave/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253183262,"owners_count":21867391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T05:01:13.851Z","updated_at":"2025-05-09T03:33:04.861Z","avatar_url":"https://github.com/chamberlainpi.png","language":"ActionScript","readme":"AIRFileSave\n===========\n\n**Latest Updates:**\n\nYou can now *Append* data to a file (instead of having to remember the whole file each time). This becomes useful for writing continuous logs, especially automated projects.\n\nSee what else has changed: https://github.com/bigp/AIRFileSave#updates\n\n----------------------\n\nEver wanted to dynamically write local files from a Flash game/app at runtime (without server-side scripts)? This handy AIR app can serve as a 3rd-arm for your Flash projects that needs to dynamically update JSON, TXT, or even ByteArray files. Also useful for launching NativeProcess (batch, commands, etc.)\n\n----------------------\n\nIt's true, there already exists a way of saving files from a Flash app by prompting a FileReference dialog, letting the user pick a path / filename and saving the bytearray to the user's system.\n\nBut what if you're working on a personal project? What if you're adjusting certain values in an XML or JSON file to tweak your game's flow? What if you're calibrating the scroll speed of your UI menus? Are you going to constantly go back and forth between editing and compiling your project until you get it right?\n\n\nA Different Approach\n----------------------\nSince you probably know the path to the configuration/levels files of your game and/or app, why not integrate some kind of **auto-save** in your project?\n\nThe way this works - AIRFileSave is an AIR app that uses a LocalConnection approach to \"listen\" to the client (your game/app) to initiate any file writing / reading / directory-listing commands.\n\n![How it works](https://raw.githubusercontent.com/bigp/AIRFileSave/master/images/afs_how_it_works.png)\n\nYou ask: \"**If this is using LocalConnections, do I need to setup the client LocalConnection to communicate with the AIR app?**\" - No worries! You don't have to setup a bunch of cumbersome LocalConnection details yourself in your project! This is handled for you in the client SWC, which you can create from the AIR app directly:\n\n![How it works](https://raw.githubusercontent.com/bigp/AIRFileSave/master/images/afs_how_it_looks.png)\n\n------------------------------\n\nUsage of Client SWC\n=============\n\n    //Instantiating a new Client automatically connects to the AIR app.\n    var theClient:AIRFileSaveClient = new AIRFileSaveClient();\n    \n    //Save a plain text file:\n    theClient.saveText(\"myFileName.txt\", \"Hello World.\");\n    \n    //Save a byte-array file:\n    theClient.saveBytes(\"myDataFile.bin\", theByteArray);\n    \n    //List a Directory:\n    theClient.listDirectory(\"C:/Temp/\", function( pFileNames:Array ):void {\n        trace(pFileNames);\n    }\n    \n    //Create / Remove:\n    theClient.createDirectory(\"theDirName\", onDirCreated);\n    theClient.deleteDirectory(\"theDirName\", onDirDeleted);\n    theClient.deleteFile(\"theFile.txt\", onFileDeleted);\n    \n    //Last but not least, here's a way to call a command (Batch) file: (not fully implemented yet)\n    theClient.startCommand( \"theCommand.bat\", [\"Hello\", \"World\"], onCommandCompleted);\n\n\nDemo\n====\n\nYou can find a pre-release *.EXE installer on this GitHub page:\nhttps://github.com/bigp/AIRFileSave/releases\n\nAlso, once you have the AIR app running, you can try this online demo to see if it writes a plain text file under:\n*C:\\temp.txt*\n\nTry it: http://pierrechamberlain.ca/others/airfilesaveclient/index.html\n\nUpdates\n======\n\n(2014-08-14)\n\n- Added \"**appendText()**\" and \"**appendBytes()**\" methods to the Client and Server.\n- Refactored so that appendText/appendBytes/saveText/saveBytes reuse the same core method but only differ in which **FileMode** (APPEND vs. WRITE) type they use.\n\n","funding_links":[],"categories":["Utilities"],"sub_categories":["Other Utilities"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamberlainpi%2FAIRFileSave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchamberlainpi%2FAIRFileSave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamberlainpi%2FAIRFileSave/lists"}