|
||||||||||||||||
Categories
Featured jobs
Our network
Advertisement
|
Ruben Swieringa
Colin Moock on Actionscript 4 (FITC Amsterdam 2008)
By Ruben Swieringa | Published
03/5/2008
Last week at FITC Amsterdam I attended Colin Moock's session about the next version of ECMAScript. As ECMAScript is the language standard on which Actionscript is (somewhat loosely) based, this means that most proposed features for ECMAScript 4.0 will also be in Actionscript 4.0 (hence the name "Actionscript 4??"). Do note that most of the proposals are still just that. Here's a quick summary: Record type - The record type is like a light-weight class and lets you define a set of properties that any variable of that type should have. Array type - The array type lets you specify the allowed datatypes for values in your array, in a semi-indexspecific way: Union types - ECMAScript 4 allows you to specify multiple allowed datatypes for a property, return-type, etc: Nullable & non-nullable types - With the ? and ! characters you can (respectively) allow or keep variables from carrying null-values. The same goes for classes. Lexical block scoping - ..gives you just a little more power over the scope to which your variables and functions are local. Just surround the required scope with accolades ( { and } ) and declare your variable with 'let' instead of 'var'. One-line methods - Lets you declare write a function in pretty much the same way as you would a one-line if-statement. ||= - Easy for assigning default-values: Method overloading! - Hooray. Yeah. Operator overloading - Useful if you would want to have + (the plus-operator) perform a concat-operation when executed upon arrays. cast-operator - As in AS3 there's still a difference between the as-operator and the oldskool-way of casting (MyClass(myVar)), the cast-operator will be introduced to replace the latter. Datatype switching - ECMAScript 4 will allow for variables their datatypes to be evaluated through a switch-statement, which is kinda cool. Multiline strings - Putting three double-quotes at the start and end of your string will allow you to have it spawn multiple lines, you also won't have to escape any double-quotes you have in your triple-quoted string. . For those of you interested, here's the online version of Colin's presentation: Comments
|
Search Entire Site
Advertisements
Latest New Articles
Set up a simple IIS Server for Flashby Peter McBride Day 1 at FITC Toronto 2008 by Anthony Pace Simple reflection effect with AS2 by Jean André Mas ActionScript.org Meets Josh Tynjala (aka dr_zeus) by ActionScript.org Staff Rapidly Create Online Flash Movies to Help Users Market, Sell and Support Software and Hardware by Sabrina F |
||||||||||||||
| © 2000-2007 actionscript.org! All Rights Reserved. Read our Privacy Statement and Terms of Use... Our dedicated server is hosted and managed by WebScorpion Webhosting. |