Home

School

Work

Play

work

ajax

Adobe Contributes to Mozilla Foundation by Open-Sourcing Code From Flash Player Scripting Engine

Posted On: Sat, 11/11/2006 - 08:00 by charles

That’s right, Adobe has made a move to open source code from their ActionScript Virtual Machine (AVM2), which is the powerful scripting engine used in the Adobe Flash Player. A very big contribution, it bodes well for web designers, web developers, and dare I say, all Internet users in general. In fact, I might be so bold as to say, with the works of Apollo in the mix, this move may also help application developers and computer users alike…but that’s a whole other post :)

For those of you that are unfamiliar as to what this all means, I’ll take some time to break it down. I’ll start with some background.

ActionScript is the programming language used in Adobe technologies such as Flex and Flash. The ActionScript Virtual Machine is the scripting engine used in the Flash Player. Particularly, the ActionScript Virtual Machine 2, or AVM2, is the scripting engine used in Adobe’s latest Flash Player, Flash Player 9. Actionscript is also an ECMAScript-based language (i.e. based on the ECMAScript language specification, 3rd edition), just as is JavaScript. If you’ve worked with either, you know that they are quite similar. So, ActionScript and JavaScript are closely related languages.

What Adobe has done is they have contributed source code from their new AVM2 to the Mozilla Foundation (now under the project name, Tamarin) with the goal that making this code open source will accelerate and grow the ECMAScript 4 Standard language specification (ES4). That’s great, if you ask me!

What does it mean for us developers?
With the efficiency and performance advances that we have with AVM2, we can expect to see this for the new JavaScript engine as well. So, previously demanding JavaScript applications may become more feasible (including AJAX applications).
Aside from performance, there are also many language features that we see with ActionScript 3.0 that are desirable in JavaScript. As they develop ES4, we can expect that JavaScript and ActionScript (already closely related), will become even more similar, so a developer can leverage the knowledge of working with either language. This standardization across languages means that our work can reach more browsers, more sites, more machines, more people. Even further, we might be able to expect developer libraries and tools that can be re-used and applied for JavaScript AND ActionScript. So, I can develop a library in ActionScript for use in Flash, but would also work JavaScript…awesome.

What does it mean for everyone?
On a larger scale, how does this move from Adobe affect everyone else? Well, first of all, working directly with Mozilla, all Internet-users can look forward to future versions of Firefox and Mozilla-based browsers with better performance when running JavaScript- and ActionScript-based applications. Again, with standardization in the languages, there can be better support for these "Web 2.0" technologies.

Most significantly, AJAX, Flex and Flash applications will become more efficient and will become even more common on the internet (I can imagine it shortly becoming a "standard" on new sites), spurring the whole "Web 2.0" buzz.

Conclusion
This is a big move for Adobe to make. It will help grow the developer communities and contribute to Internet-users in general, by "empowering the creation of even more innovative applications in the Web 2.0 world"*. I couldn’t agree more.

*Kevin Lynch, Senior Vice President and Chief Software Architect at Adobe

Charles

Flex vs. AJAX

Posted On: Tue, 08/01/2006 - 07:00 by charles

Whenever people think about the next generation of web applications, many people think AJAX. Others think Flex. These two worlds often collide, with many blog entries and articles written on the subject comparing the two, deciding which is the hands-down best technology for you to use on "your" website. The problem that I see with this is: "who decided that these should be competing technologies?" Sure they are separate methodologies, and learning both takes longer than just picking one and going forward with that. But, if you really want to build a quality web application, then it might be in your best interest to tough it out and just learn both. Really, they’re not that different from each other. If you're learning one (or have already learned one), then a lot of that will carry over to the other. JavaScript and ActionScript are both ECMAScript-based* languages, so they are very similar, not only in syntax, but usage as well.

I'll give you a list of what I think are important strengths and weaknesses of the two, but keep in mind, I am happily on the fence when it comes to deciding between them, and I’ll tell you why in a bit.

Flex - strengths

  • great for rich interaction and media heavy pages
  • has Flex Builder IDE, built off of familiar Eclipse IDE
  • Flex Builder has design mode for those non-programmers interested in building Flex apps
  • greater access to multimedia components of your computer
  • effective use of caching for improved speed

Flex - weaknesses

  • ActionScript and MXML, although similar to JavaScript and XML, are not as common in everyday pages
  • back button and right-click don’t have desired effects without enhanced coding

AJAX - strengths

  • great for large text-based content
  • Open AJAX Initiative
  • also strong caching (depending on implementation) for improved speed

AJAX - weaknesses

  • heavy amounts of JavaScript and DHTML to achieve certain dynamic effects
  • no IDE with integrated debugger
  • back button can easily be broken with certain applications of AJAX

As you can see, both have their strengths and their weaknesses. It can be appropriate in certain applications to use one over the other, and vice versa. But with that in mind, who’s to say that you can’t use them together? Well you CAN, taking the best from both worlds, especially with the help of a library for Flex, created by Ely Greenfield (one of the original developers of Flex), called the Flex-AJAX Bridge, or FA-Bridge for short. The simple summary of what this does is it allows your ActionScript code to be available to your JavaScript code. For example, if you wanted to change a value in your Flex app such as a panel width, normally you would have to do it through AcionScript with a line of code something like "my_panel.width = 250". But with the FABridge library, you can do this through your JavaScript code, like so: "flashApp.my_panel.setWidth(250)". You can read all about it on Ely’s blog, QuietlyScheming. I think he puts it best by saying…

Smart developers take the time to equip themselves with as many different tools as they can, and great web apps use the right technology for the task at hand

For those of you that were sitting on the fence, looking for a nudge in a certain direction, hopefully I’ve convinced you to stay there. Try this solution out and see for yourself. There’s plenty of room on the Internet for both Flex and AJAX. If you come up with anything cool, feel free to share!

Charles

( categories: )

Charles Bihis is a Computer Scientist for Adobe Systems. The views expressed in this blog are his own and do not necessarily reflect those of his employers.

 

Subscribe