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

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

Related

ActionScript 3- Wrap DYLIB to be used with AS3

I have to create Flash application with AS3 and use functions in DYLIB.
Let say the function name is Open();
Is it possible? And how do I add the DYLIB into my AS3 project?
EDIT
Ok as I can see from the comment, I need to wrap the DYLIB. I am not sure how to do it. Can anyone help ?
To get a dynamic library to work with AIR you must create an ANE (AIR Native Extension) that uses the dylib. The ANE you create should expose parts of the library that you require as AS3 functions.
There are many tutorials available for creating ANEs, start with:
https://www.adobe.com/devnet/air/articles/extending-air.html
Once you've created the ANE that accesses the dylib, when packaging your application you must go through a few additional steps to correctly sign the dynamic library.
make sure you are using AIR 27+
add a Frameworks directory to your application at the root level
ensure this directory is packaged with your application
place any dynamic libs and frameworks in this directory
These libraries will then be correctly signed with your application certificate.

Can we use wxWidget to save a webpage onto the disk

I was using wget with system call (c++) to save a webpage from internet to my HD in a program. Now I want to use wxWidget to do the same. Is there anyway I can do that and still have the generic behaviour of wget? (i.e. i give a link to a pdf file n then a pdf file is saved)
I found this link http://wiki.wxwidgets.org/Download_a_file_from_internet
but I have no idea how to convert wxString to a pdf/mp3 file according to the url entered.
Could anyone help please. I am working on an open source project for the first time and I encountered this wxWidget just now
If you are happy using wget with a system call, then why not continue to do so?
wxWidgets is a GUI framework, with a lot of extra convenience functions included. You don't HAVE to use them. You can still use whatever C++ features, utilities and packages that your are familiar with.
Here is a link to Wget for Windows
You can use wxHTTP (as described here) or use wxURL and GetInputStream()

Call A Method In Dll Using HTML5

I have a dll file and i need to call a method in the dll and return some value.
Before i have used a VB script and called it from a html file that runs only on IE.
Now i need to call the dll directly from HTML5 without using any VBScript or Javascript.
Which tag can achieve this and that can be run in almost all browsers.
Please help me.
Thanks in advance.
There is an <embed> Tag, but it's not for DLLs. In fact there is no tag which allows you to call DLLs at all.
So you should step away from the idea to do your processing on the client-side and just move it to the backend. Create a ASP.NET-Service if you have to use your DLL. You can even use PHP5 (using COM functions) if it's running on a Windows server.

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/

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.