Cross-compiling Flex/Flash to Javascript - javascript

Are there any options for compiling Flex/Flash projects into Javascript/JQuery? I seem to remember this feature possibly being part of Adobe's latest dev tools?

Check out http://www.jangaroo.net

Adobe is now working on Falcon(JS).
that would crosscompile Flex projects to JS.
http://blogs.adobe.com/bparadie/2011/11/19/what-is-falconjs/

Adobe has contributed the FalconJS proof-of-concept or prototype source code to Apache Flex. This is not a finished product, but some simple applications can be cross-compiled to JavaScript. The source code can be check out here:
https://svn.apache.org/repos/asf/incubator/flex/falcon/trunk/compiler.js/
FalconJS depends on the Falcon compiler, which has been contributed to the Apache Flex project as well, here is the wiki page with the build instructions for Falcon:
https://cwiki.apache.org/FLEX/falcon-overview.html

OpenLaszlo is an open-source development platform that can compile applications into either a Flash SWF or HTML5/DHTML (ie: HTML+JavaScrtipt). The syntax of the language consists of XML mixed with ActionScript/JavaScript:
http://www.openlaszlo.org/
Note:
ActionScript and JavaScript are both implementations of the ECMAScript language (http://en.wikipedia.org/wiki/ECMAScript) and thus are nearly identical. Anyone familiar with programming in ActionScript or JavaScript should feel right at home with OpenLaszlo script.

Related

Packaging node-webkit App

https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps
While packaging my node-webkit app for windows using the steps given in the above link I could not find how to avoid readability of the resulting executable from the merge by archiving software, such as WinZip. EXCERPT(from link above): "The resulting executable from the merge will still be readable by archiving software, such as WinZip."
Is it possible to avoid readability by the archiving apps?
Any help is appreciated!
Fundamentally, running node-webkit is similar to running in a browser, so just as you can't hide your webpage source, you can't truly hide your HTML and CSS in such a way that it can't be read, because it needs to be read by node-webkit at runtime.
The situation is almost the same for Javascript code, with one exception. V8 (the javascript engine in Chrome) provides a "snapshot" capability, which sort of compiles your Javascript into a sort of bytecode that V8 understands. Nwsnapshot is available for node-webkit, which will allow you to avoid shipping your JS code (or at least some of it). However, this option is still experimental, and in fact there is a problem in version 0.8.* of node-webkit (referred to as v8 in the wiki, but not to be confused with the V8 js engine), though it should be working again now in v9. Details can be found here if you're interested:
https://github.com/rogerwang/node-webkit/wiki/Protect-JavaScript-source-code-with-v8-snapshot
Also be aware that it can have performance impacts, if that matters for your application.
You could also make an exe file.
See "Step 2b: Alternative way - Making an executable file out of a .nw file" from the link you provided.

programming in javascript with Visual Studio (2010)?

Whether you are forced to code javascript in Visual Studio 2010, or insist on using Visual Studio 2010 instead of another IDE, I'm wondering what anyone has done to improve the javascript development experience in VS2010.
I'm asking since javascript support is lacking in Visual Studio 2010. You don't get the the kind of support you get as if you were developing Silverlight apps in C# and XAML. For example, the intellisense doesn't support javascript 1.8.5 (or even 1.6 functions i.e. JSON.Parse), it's difficult to navigate to function or object definitions (no Go To Definition), no Object Browser, Call Hierarchy, and the list can go on.
What have you done to compensate for the VS2010 features that don't exist for javascript? Also, what would be a good feature request to support javascript development; anything that VS2010 should add as an extension or a future release? Also, are there any suggestions to manage the .js code for large projects?
A few things that have helped me so far are the JScript Editor Extensions, and the Web Standards Update. Also, when working in .js files I rely on bookmarks to get back to key places, since the functions of the file aren't visible (as the would be in C#). My feature request would be to add intellisense support by javascript version, similar to how you can target .NET 2.0, 3.5, or 4.0.
There are a number of VS extensions to assist with javascript:
Visual Studio Javascript extensions feature comparison
JSEnhancements is awesome, and does what you really want: adds regions and code block collapsing.
Also see this extension: http://code.google.com/p/js-addin/
which parses your script into an object tree that can be used for navigation.
I have also used the free version of this editor: http://www.yaldex.com/JSFactory_Pro.htm
I can't recommend it, unfortunately, because it suffers from a couple critical problems (awkward UI, freaky intellisense, and not entirely stable). Which is too bad because it's a very thoughtfully designed piece of software by and large, it just fails where the rubber meets the road.
1) Install Resharper, helps a lot when building javascript heavy web apps.
2) Get FireBug for debugging.
3) Also, the JQuery.vsdocs files are sometimes helpful!
While I use vim and Notepad++ to cut code, I feel your pain, or did until I started using Firebug to debug JavaScript. While it many not be exactly fitting for your situation it's invaluable to me in developing Web based apps:
http://getfirebug.com/

Are there currently any engines for compiling JavaScript to an standalone app with graphics support?

Ive seen things like Mozilla Rhino, or using V8 internally. What I am really looking for however is a solution where I can basically write standalone Canvas apps for the PC. Titanium was ok, but I didn't like the end result. Basically Im looking for the ability to write PC client apps with graphics support using JS, that compile into an application. I don't want something where all resources are totally open for anyone just to take/change and re release as their own. Big picture is to have the option to monetize a game if I chose to. Is there currently anything like that out there?
Adobe AIR 2.5 has support for the canvas tag. It uses Webkit, however it doesn't support somethings current Webkit browsers have. Such as video/audio tag, svg. Here is a decent list of supported/unsupported features of the Webkit build in AIR.
This is a rather old question, but I wanted to give an updated answer to what I found. You can use QT to do exactly this. You include a webkit widget in the window, and load your js/html/images via resource files which are embedded into the application.
http://www.somethinghitme.com/2012/03/29/turning-canvas-games-into-executables/
I like this solution over the Air solution, because all of your assets can be contained and hidden.
A better approach to my previous answer is to use nodeWebkit.
Here are the following benefits over the previous method which used QT.
Requires no seperate IDE like QT
Requires no boilerplate code at all like QT
Very easy to pack up all dependencies and resources into a single executable
Uses V8 and is updated regularly to stay current unlike QT's implementation
For canvas specifically I have used it for the game grapple hero and Rezoner has used it for his game qbqbqb. There are many more examples of its use in the wild. It is as of today the best solution.
I would try XULRunner. I use it whenever I don't feel like coding a whole application, and it works quite well. XUL is an XML-like markup language which is used for layout. Here's some example code:
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="vbox example" title="Example 3...."
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox>
<button id="yes" label="Yes"/>
<button id="no" label="No"/>
<button id="maybe" label="Maybe"/>
</vbox>
</window>
CSS is used for styling the application, and JavaScript for the backend. It's quite easy to code with, and the whole application is like a standalone website. I coded a few download managers with it, but you can just migrate your HTML <canvas> straight into the code with minimal modifications.
To build an application, you just place the layout and functionality files into a folder, optionally make a JAR out of it, and just copy it into the XULRunner directory. You just run the executable, and it's good to go. Best of all, the same code works in Windows, Mac OS, and Linux.
Good luck!
(Here's the best reference for XULRunner, since it's Mozilla's baby: https://developer.mozilla.org/en/xulrunner)
Wait, are you talking about the iPhone? You should have tagged that if you are... XULRunner is only available for every platform except iOS. Doesn't that make you love Apple?
jslibs is a standalone JavaScript runtime (based on Firefox JavaScript engine) that support OpenGL (and a lot of other 3rd party libraries).

IDE for ECMAScript-262 with in IDE execution / debugging for node.js/V8

I currently use Eclipse as my IDE for other languages and I'm rather used to not having to leave the IDE for anything - however I'm really struggling to find the same or a similar setup for pure ECMAScript-262.
To clarify, I am not looking for DOM support, jquery, HTML or anything like that, preferably just an IDE with ECMAScript-262 support (pref node.js) built in (debugging not important) so that I can simply run my code in the IDE.
Any ideas?
ps: please don't suggest aptana.
jEdit is about what you want. Take a look at the plugins available.
So far, it seems there has only been talk about integrating node.js debugging with Google Chrome. But that may be exactly your answer if it happens.
If you don't mind to pay a price, I advice Jetbrains WebStorm.
Recently purchased a license myself (it's not that expensive) and am very happy with it.
Before I used Eclipse and Aptana, but seriously, WebStorm IS quality.
Not sure if I am currently breaking a rule by linking to a commercial product, but it IS an awnser ;)
There is Nodeclipse effort.
Vision
One-stop shop for Node.js tools. We can't develop everything at once,
but we let you know what are the best things around for Node.js
development with Eclipse.
Latest version is 0.4, works well in Eclipse 4.3 Kepler.
It has integrated ChromeDevTools and V8 remote debugger for debugging Node.js application,
that is quite useful when learning Node.js to understand what is happening in memory.
Also comes with markdown (.md) Editor (The same markup language that is used on GitHub, Stackoverflow.com & npm)
It is free open-source hosted on GitHub

Is Javascript only available for web browsers?

I would like to know about Javascript. Is Javascript available only for web browsers? Because I used some Javascript code for Firefox Plugin development and Thunderbird.
Help me to find out more about this: where can I use JavaScript other than web browsers, and how?
There's node.js which includes a full webserver and runs on Google's V8
No! Have a look at Google's V8
Google Javascript. Click first link (Wikipedia). Click "uses outside webpages".
http://en.wikipedia.org/wiki/JavaScript#Uses_outside_web_pages
There are a number of server-side (or otherwise non-browser) implementations of Javascript, including Node.js, which currently has a lot of momentum behind it, as well as the now-defunct Jaxer, which provided a server-side DOM implementation based on Mozilla Gecko. There are also efforts to bring DOM type functionality to Node.js, primarily from Yahoo.
With Rhino, you can embed Javascript in Java applications.
No, there are definitely other implementations. For instance, JScript.Net is included with the .NET framework.
MS-Windows can execute .js files (from the command prompt).
Since you do not have the browser context, you cannot use any calls to the browser (alert, for example, does not work).
Look for "Windows Scripting Host".
WSH supports scripts written in
Microsoft Visual Basic Scripting
Edition (VBScript) or JavaScript.
There are several implementations of stand-alone Javascript
JSLibs (http://code.google.com/p/jslibs/) is general purpose
jsdb (http://www.jsdb.org/) is more database oriented
Many text editors (including the one I use, ActiveState's Komodo Edit) expose their APIs and let you write macros in Javascript.
Using Adobe AIR you can write almost platform-independent Desktop Applications using JavaScript
PDF files can also contain JavaScript code. See first entry in google on this subject and also Adobe JavaScript virus.
Javascript can be easily embedded in applications written in other programming languages.
For Java there is as already mentioned Rhino, for C++ you can use for example Flusspferd. Here are some tutorials/examples.
Qt has the QtScript module. From Qt 4.7 it uses JavaScriptCore (the Webkit JavaScript engine).
In short, No.
Actually, Javascript and other Web technologies are used these days to create native mobile and desktop applications. (see Titanium Appcelerator and PhoneGap)
If you are familiar with the KDE project you can craft Plasma widgets using JavaScript, see Creating plasmoids with JavaScript
In Qt framework there is a QtScript module for JavaScript (ECMAScript) application scripting to provide much of the application’s functionality.
Also the new technology that is soon to be released in Qt 4.7 is Qt Quick, aka the Qt UI Creation Kit, which allows application developers to declaratively define their user interfaces in QML, for more information go here and an example here
QML is an extension to JavaScript,
that provides a mechanism to
declaratively build an object tree of
QML elements. QML improves the
integration between JavaScript and
Qt's existing QObject based type
system, adds support for automatic
property bindings and provides network
transparency at the language level.
And let's not forget Javascript is used as an embedded scripting language in various applications OpenOffice.org, Google Desktop Widgets, and many others, see Wikipedia's article here
On the server-side Javascript enables back-end access to databases, file systems, etc (see Node.js, Google V8, SpiderMonkey and others here)
Some document databases, such as CouchDB and MongoDB, use JavaScript to interact with the database.

Categories