Updating AIR application with embedded runtime? - actionscript-3

I'm writing a AIR application with an embedded runtime (.app) and am having trouble finding a way to update it. I need to somehow download a new .app off a server and overwrite the existing file, and promptly restart the application. I'm clueless on how I'd achieve this.
Any ideas?

Try this: https://code.google.com/p/nativeapplicationupdater/
Or, if you only need to update some content that is used by the app, you can just have your app download it using URLLoader and store it using File, say to File.applicationStorageDirectory.

Related

Adobe AIR doesn't save file with file's extension

I am working on Adobe AIR application and some test users report to me about same issue. When they try to save the project file from this application, they have no possibility to add any extension (".txt", ".xml" or any other) to the file. All these users use Microsoft Windows.
What can be the cause of the problem?
It looks like this is a pretty standard issue with the browseForSave method of saving files. This post should give you a workable solution for ensuring the correct filetype is entered: http://analogd.com/blog/adobe-air/adobe-air-tips-serie-browseforsave-set-default-file-extension-and-validatemodify/

Possible to natively create hidden file or directory using AS3 / AIR?

Am I blindly missing a method for creating a hidden file or directory in an AIR / AS3 desktop app? Re-combing the docs, all I see is the File.isHidden read-only property. I know I could do this via NativeProcess and native code, but I'm hoping to avoid creating native code.
Thanks!
In Mac and Linux you only need to put a dot (".") in front of the file/folder name.
For Windows is a little bit more complicated since it is a property of the file. I've done it in the past by calling the "attrib" command, but yeah, you would need NativeProcess for that AFAIK.
Juan

HTML5 Local Storage - Creating and writing to a json file?

We are building a web application using SVG & JS. The log file for this application needs to be created on the client side and then finally uploaded to the server once the project is ended.
As we donot wish to go near ActiveX controls, is it possible to achieve this with the new HTML5 'Local Storage'? Isnt that what 'Local Storage' is for anyways?
Is there a working example of this as well?
Many thanks,
Not really sure what you mean by this but there is something out there called jStorage.
It uses javascript and json to save data to the local database.

AS3 URLRequest XSS?

Im basically working on an image analyser that downloads images from another server. I have no control over the server but I only want to scan images not html pages.
would something like this work?
new URLRequest('http://otherserver.com/someimage.jpg');
Or would I have to use a PHP script to act as a proxy for my script and have the swf look up that php script with parameters instead?
new URLRequest('http://myserver.com/proxy.php?image=someimage.jpg');
I only ask because I remembered AJAX requests wont work cross domain so I wondered if the same thing affects AS3 aswell.
You need a cross-domain-policy:
http://help.adobe.com/de_DE/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7e08.html

Can an AIR app be programmed to handle a URL protocol?

I'm writing what is essentially a browser in Adobe AIR (ActionScript, not AJAX). A great bit of functionality to implement would be protocol handling. iTunes, for instance, handles itms protocols; when your friend sends you a link beginning with "itms://", it's going to launch iTunes as long as it's installed. Is there a way to write an AIR app (requiring AIR 2 would be fine) that can be the "handler" for a protocol in this way?
There is no way, programatically speaking, to specifically handle a particular protocol. However, there is InvokeEvent. InvokeEvent will be fired when the application is "invoked", either when it's explictly launched or if an associated file or URL is activated.
The process of associating your app with a particular file type or protocol scheme is separate and application-dependant. In iOS, for example, you would need to specify the protocol in Info.plist under CFBundleURLTypes/CFBundleURLSchemes.
Yes. You can use the URLLoader class to download data in binary form (URLLoader.BINARY) and then parse this as appropriate. See this CS3 documentation on working with external data.
http://www.patrick-heinzelmann.de/labs/lastfm/
I'm not sure exactly how it works and I don't see a way to download the app, so I can't even test it, but maybe it will help...
Check out this page. I am trying to find out the same thing, but I haven't found any solution to do it with just Air yet. Seems like you might need a custom installer to setup the correct registry entries, and a proxy application to "wash" the input to a correct format that then can start your application with the correct command line parameters. Hope this can be of any assistance.