Colin Moock on AS4/ECMAScript 4.0 at FITC
The standards talked about are not slated to be implemented until at least december 2008.
You can see Colin’s notes from his presentation at the following address:
http://moock.org/lectures/newInECMAScript4/
Here is a summary of what he covered in his talk, this is all covered in the link above but I thought that I would just post the items that interested me the most:
Structure Types
- record type
easier way to create custom object types, instead of using classes
- array type
ability to apply types to elements within arrays
- union types
gives the option of assigning one of several datatypes to a variable
ie: var x:(int|string) // x must be either an int or a string
Type changes:
It looks like byte, uint, int are being removed from ECMAScript but they will most likely stay in AS for the time being.
There are a series of new lower case types including string, number, and boolean
There are going to be non-nullable types that cannot be assigned the value of null, the idea is to save time in type catching.
Lexical block scoping lets you create variables without var, it allows you to create assign values to variables within code blocks. Check the lecture for an example, it looks like it would be useful if you have a temporary variable.
You will have the power to create single line functions in the same way that you can currently create a single like conditional statement.
!!= can be used to shorten variable assignment, can turn myVar = myVar || “default” to myVar !!= “default”
Type casting can be done using the operator “cast” ie: food cast Apple
Switch type can be used to test the type of variable in a switch statement to allow for multiple types and custom functionality for each
String indexing looks like it may be a little useful, you can access characters in a string the same way that you would access items in an array “test”[2] would produce “s”. Similarly you can use slice on a string to get a range of characters quickly.
Thats all for now.











January 30th, 2009 at 10:05 am
_3ds.setChildMaterial I get an error (1061) on this line flash can’t find method related,please help I get a blank screen!
Netto
January 30th, 2009 at 10:32 am
are you working with the latest release of Papervision?
January 31st, 2009 at 12:03 am
i’ve never used the 3ds parser, i’ll give it a try. If i put some lights in 3D Studio, will they appear in PV3D with the 3ds parser? (i guess not, but i don`t have 3d Studio to make a test right now).
Very nice article by the way, thanks.
February 1st, 2009 at 1:18 am
thanks for the nice comments bioRex.
I know that the 3ds parser will load the lights as objects. But I don’t believe that there is much that can be done with them. I would recommend using dummy objects, either in the 3d scene or in the papervision scene.
February 7th, 2009 at 1:47 pm
in your example you apply a material to the collada object via code but what if the object has a material(defined in a 3d application) already applied ?
February 7th, 2009 at 2:00 pm
and one more question…you said:
These are good files to use if you would like to import assets that include animations.
So far so good but how can i control the animation in papervision.For example a simple walk cycle animation created in Cinema 4D via keyboard input in as3 and pv3d ?
February 7th, 2009 at 2:11 pm
I will work on creating a part 2 of this tutorial over the next couple days and see if i can answer some of your questions about animation and materials.
I can assure you that both things are possible (loading animations and using materials that were used in the 3d application).
March 17th, 2009 at 1:11 pm
VERY NICE FILE….i’m new in papervision i see your tutorial, but i don’t understand how i can change the 3dobject. i have my .3ds file and i put in my folder,then i change the extensione in Max3dsParser_v1 and export the .fla…. i need to know if the Max3dsParser_v1.as is remain the same or is an .as created from 3dstudio?
March 17th, 2009 at 1:16 pm
just find knot.3ds within the Max3dsParser_v1.as and change that to the name of your 3ds file. the rest can remain the same
March 17th, 2009 at 7:11 pm
doesn’t work…maybe my exporto in .3ds is wrong? i can’t see my file but still remain your knot.3ds…!!