Is there any way to create an Air 2 program that runs just in the command line? (no windows, no gui, etc)
Something similar to Windows Ping program. It would accept arguments and then output std out.
No, AIR is not really meant for creating command-line applications - it's just not the right tool for the job.
You would be better off looking at implementing your application in Java, C#/VB.NET, Python or Groovy (and innumerable other more suitable languages).
If you really have your heart set on Actionscript/Javascript-style syntax then you should look into Haxe.
You might want to check out CommandProxy as a possible solution.
Related
I can't any specific documentation of if you can or cannot, but I'm guessing there's a reason why. I'm looking to close down an application via AIR. (e.g. Close Photoshop with the press of a button inside of an air application).
As of right now AIR cannot see current system processes? I think!? So i'm guessing I can't but if anyone has found a recourse or has any information that would be very helpful. One way or another.
Thanks!
You cant do it directly from AIR but it could be done by using an ANE. However, you'd probably have to write the ANE yourself - i doubt anyone has created exactly what you need.
Would depend on the OS, but under OSX/Linux you could use something like ps to search the running processes and kill the one you required by executing a script through the NativeProcess call? Not really sure on the Windows equivalent though I'm sure there's some Powershell stuff you could do. Something like this combined with a kill script?
ps aux | grep Adobe\ Photoshop
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/desktop/NativeProcess.html
I am using for an alternative to OpenGrok. I can't configure it properly. What I want is to browse to the code, like I would be in Visual Studio. I'd like to have a menu with a minimum option of Go To Definition, find references etc. How can that be achieved ?
I suggest to have a look at the Woboq Code Browser.
It works like a compile step and dynamically analyzes the code and how symbols are linked to each other.
Did you have problems configuring it on Windows?
OpenGrok works best through a web-server. You might find it easier to rent some cheap VPS box, and configure OpenGrok remotely on such server (instead of trying to configure it locally on a Windows box), and then use your web-browser to access the remotely-running OpenGrok instance through the web-interface.
I've once tried using OpenGrok locally on a Windows machine, and even though it worked, I was not happy that the non-web version didn't have any syntax highlighting, and was overall just way too awkward to be of any real use.
There's Text-Sherlock. And the github project. It can use either Whoosh or Xapian as its backend.
I would recommend Codatlas. It has features such as jump-to-definition and cross-reference and poly-glot support such as C/C++, Java, Python, Scala etc.
Is there any way to use the library of other language in Action Script 3 ?
For C/C++
I learned that we can use Alchemy: http://labs.adobe.com/technologies/alchemy/
But for other languages (here I mean Ruby or Java), can I use their libs via AS3 ?
Alchemy is a cross-compiler from LLVM to ABC, if the language you are interested in can compile to LLVM, then, in theory, you can compile to ABC. So, Alchemy supports (with some tweaks) also C# or Java (but you will have to spend some time getting them to work together, there's no out of the box solution).
AIR (which is a desktop variant of Flash) can use something called "NativeProcess" which means that granted the operating system can execute the code in the library, then you can do so by creating a new process that calls the function from the library you need.
In AIR, again, there's a new feature called ANE (AIR Native Extensions) - this allows you to bind AIR more tightly to the native code. But, it doesn't need to be native as in object files only, it should be something the underlying system can execute. But I have to confess, I never tried creating any such extension, so my knowledge of it is theoretical.
No you can not use Ruby or Java code/libraries in Flash. Alchemy only allows you to use C and C++ libraries. The only way is to port those libraries to ActionScript, or maybe the library you want to use has already been ported to AS3.
It is also possible that there is something similar in AS3. You could ask another question here or on an Flash forum if anyone knows if the library you need has an equivalent in flash.
Is there some sort of interactive ActionScript interpreter? Similar to Firebug's JavaScript command line or Python's interactive shell?
Try AS3Eval Library - it is AS3 compiler implemented in AS3. It has simple interactive shell.
There's also Frontal:
http://code.google.com/p/frontal/
It has an ActionScript interpreter built into it. It's based on the ECMA 2.62 (JavaScript) standard so it's not full AS3 and doesn't support things like packages and classes but it's still extremely handy.
As I mentioned, the interpreter is part of a larger library implementing the Frontal language but if you were so inclined you could pretty easily just rip out the interpreter.
Or you could just use it in Frontal. And if you did then you do get a console that allows you to run ActionScript in a primitive shell. For example, go to the Frontal website. (I can't post the link because my reputation is low but it's frontalcode + com.) Right-click and choose "View Frontal Source..." This will open the Frontal console. At the bottom of the console, click "command line." This is your "shell."
Try something like this say:
5 + 4 * 10
or
movie.alpha = 0.5
Actionscript is a compiled language and the compiled byte code is executed by the Flash Player Virtual Machine. There are a number of tools out there that will create Actionscript byte code based on Actionscript source code. I'm not aware of the existance of any tools that will intrepet AS byte code and execute it other than Adobe Flash Player.
Although I do not say it's not possible, I haven't seen nor heard of any tools that gives you an interactive shell for Actionscript.
flash-console project does exactly that. They have a demo and an online help.
Special commands start by a slash like /help
Variables can be stored and accessed via $some_name
/ changes current scope to the last returned value.
The project is meant to be integrated in your project.
Possible? To crazy to contemplate? if yes and no (respectively) any idea how to go about doing this?
I don't know if it's possible. With newer versions of Builder and some probably not-insignificant effort, I'd guess it probably is. But why on earth would you want to? You'll end up with a version of MySQL compiled in an untested environment instead of the distribution versions provided by MySQL themselves that gain lots of testing exposure. I can't think of a single advantage of doing this, but I can think of plenty of disadvantages.
If your problem is that Builder is the only development environment you have to hand, be aware that you can compile using Visual C++ Express, which MS will give you for free.
If you really want to go about doing this, you'll be wanting MySQL's build guide and CMake. Following their instructions for Visual Studio will work to get you something you can start building. You'll then need to hack around looking for appropriate compiler options and so forth.
Shouldn't be too challenging; just use Cygwin if you'd like to compile it.