Flash CS3 announced (Euro prices too high?)

Finally Flash CS3 it’s here!
A lot of features have been included.. probably there are many reasons to upgrade, as they say:

Reasons to upgrade

– Adobe Photoshop® and Illustrator® import
– Animation conversion to ActionScript™
– Adobe interface
– ActionScript 3.0 development
– Advanced debugger
– Adobe Device Central CS3

– BUT –

I really cant understand why the US upgrade is $ 199 (this is what I currently read on the store), while in Euro it will be € 298 (which is $396).
So if I buy Flash CS3 upgrade in Euro, I will pay the double price than american people!
Bad, bad thing!!

Apollo, why so much excitement?

In these 2 days I read only Apollo related news, post and video tutorials! I dont think there is still someone who dont know about the public alpha of Apollo 🙂
I see much more excitement than for a new Flash player release.

I’m sure Apollo will be a great product, I’m just testing it right now (even if I sill have  no idea about what to create with it… but it’s another story), but to be honest I can see anything so revolutionary there.
Unfortunately I dont have so much experience with desktop flash suff (just a couple of little projects using mdm and some experiments with XUL)
What’s the difference and innovation compared with MDM Zinc, Screenweaver, Xul Runner, and all the other flash desktop integration kits?
I just hope I can find the time to use it much more in the future to give me an answer…

ActionScript 3 import alias! Where is it?

working with Flex2/ActionScript 3 sometimes you may find that in different libraries there as classes (always in different packages) with the same name.
Ok, no problem, in fact I remember I’ve read something in the as3 documentation about the import alias directive..
A quick google search and in fact I come to this page: http://livedocs.adobe.com/…?href=as3_specification106.html

Cool, I thought. Then I applied the directive in my as3 project (because two ‘Location’ classes were giving me problems in flex) but when clicked on compile it throws me a syntax error  🙁
Strange, it’s described in the documentation, but dont work!.. It’s also described in the es4 specs.
Fortunately Colin gives me an answer: “… single name aliases were indeed dropped for AS3. even if the plan is that they will go into the ES4 standard, and if that occurs, they will be added to ActionScript eventually.”
I hope it will happen soon!

IMHO, I would prefer a syntax like the python one about the import alias: http://docs.python.org/ref/import.html

Something like: import os as somethingelse, but it’s just a stylistic issue for me…

Apollo Beta in March?

Via PC World: “Adobe plans to later this month launch the beta of a new runtime that will allow rich web-based applications to run offline, technology that could threaten the popularity of programming platforms such as Java and Microsoft’s .NET.
The release of a developer preview of the runtime, dubbed Apollo, will coincide roughly with an ApolloCamp event Adobe will hold in San Francisco on March 16, according to sources familiar with the company’s plans. ApolloCamp will give developers a chance to kick the tires of the new runtime.”

Apollo on Adobe Labs: http://labs.adobe.com/wiki/index.php/Apollo
Read th full article here: http://www.pcworld.in/news/index.jsp/artId=5144613

Panoramic 360 with Papervision3d

Just before leaving for holidays I did a little test using papervision3d again, but then I forgot to post the result here…

Being able to parse 3dmax collada files and apply texture to its 3d objects I thought that with is probably the best and easiest way to create simple image panoramic viewer.

I first downloaded a trial of 3d Studio Max,  then I created a simple sphere (see the image) and attached an image as texture.
You can see here a screenshot of the resulting 3d object:

The next step is to download and install collada export for 3dsmax from Feeling Software and export the 3ds scene as collada file.

Now in flash create a new fla file with the same image used in the 3ds max file in library. Then just tell papervision to load the .dae file and associate the library image to the sphere object. You don’t have to worry about anything else 🙂

Here the script I used in the as:

package
{
import flash.display.*;
import flash.events.*;
import flash.geom.*;
import flash.ui.*;
import org.papervision3d.scenes.*;
import org.papervision3d.objects.*;
import org.papervision3d.cameras.*;
import org.papervision3d.materials.*;
import org.papervision3d.events.*;
public class main extends Sprite
{
private var container:Sprite;
private var scene:Scene3D;
private var camera:FreeCamera3D;
private var rootNode:DisplayObject3D;
private var DaeMaterials:Object;
private var center:Point;
private var rotating:Boolean;
private static var MAX_X_ROTATION:int = 12;
private var keyRight :Boolean = false;
private var keyLeft :Boolean = false;
private var keyForward :Boolean = false;
private var keyReverse :Boolean = false;
public function main()
{
center = new Point(0,0);
this.addEventListener( Event.ENTER_FRAME, loop3D );
this.addEventListener( MouseEvent.MOUSE_DOWN, mouseDownHandler);
this.addEventListener( MouseEvent.MOUSE_UP, mouseUpHandler);
init3D();
}
private function mouseDownHandler(evt:MouseEvent):void
{
center.x = container.mouseX;
center.y = container.mouseY;
rotating = true;
}
private function mouseUpHandler(evt:MouseEvent):void
{
rotating = false;
}
private function init3D():void
{
this.container = new Sprite();
addChild( this.container );
this.container.x = stage.stageWidth/2;
this.container.y = stage.stageHeight/2;
this.scene = new Scene3D( this.container );
camera = new FreeCamera3D();
camera.x = 0
camera.z = 0
camera.zoom = 1;
camera.focus = 200;
DaeMaterials = new Object();
var bmpMaterial:BitmapAssetMaterial = new BitmapAssetMaterial( "greece.jpg" );
//var testMaterial:WireframeMaterial = new WireframeMaterial(0x000000, 100);
//testMaterial.doubleSided = true;
bmpMaterial.doubleSided = true;
DaeMaterials.mymaterial = bmpMaterial;
rootNode = scene.addChild( new DisplayObject3D( "rootNode" ) );
rootNode.addCollada( "sphere.dae", new MaterialsList( DaeMaterials ) );
}
private function loop3D( event :Event ):void
{
var sphere:DisplayObject3D = this.rootNode.getChildByName( "Sphere01" );
if(sphere){
if(rotating){
camera.rotationY += (container.mouseX - center.x)/25
camera.rotationX -= (container.mouseY - center.y)/25
if(camera.rotationX > main.MAX_X_ROTATION) camera.rotationX = main.MAX_X_ROTATION
if(camera.rotationX < -main.MAX_X_ROTATION) camera.rotationX = -main.MAX_X_ROTATION } } this.scene.renderCamera( camera ); } } }

SoundMixer with Papervision3d & ImageProcessing

Recently I’ve joined the papervision3d mailing list and started to make some little test with 3ds max exported files just to see how it works and its performances.
There are various demos around the net about papervision and all of them are really impressive. Unfortunately my skills with 3D studio max are less than zero and so I could test only with basic objects..

BTW, after I’ve discovered also this great library (ImageProcessing) I decided to make a test with both the libraries together to create some effects to be used in a SoundMixer movie.

Here the result of my experiment: Main.html

Once the music starts click on the stage with mouse to change the visualization effect.
There are 6 different effects.
For the papervision objects I used these .dae files: cube.dae, plane.dae and sphere.dae ( download them )

Actionscript parsing experiences: PyBison & PLY

My experiments with text-parsing continue..

PyBison
Last day I founded a python library (pybison) which runs the generated python parser at near the speed of C-based parsers, due to direct hooks into bison-generated C code.
Cool, unfortunately I couldn’t compiled it for Windows and so I made my test on Ubuntu only. What I did was just to export the already written lexer/grammar using bison2py (boundled with pybison) and run it.

If you want to take a look at the python parser try it by downloading the source code here.
The run.py file accept these parameters:
usage: run.py [options]
options:
-h, --help show this help message and exit
-v, --verbose Turn on verbose mode
-o OUTPUT_FILE, --output=OUTPUT_FILE
Don't print to stdout but to the output file
-i INPUT_FILE, --input=INPUT_FILE
Input file to be parsed
-x, --to-xml Returns a human-readable xml representation of the
parse tree
-b, --bison-debug Print the Bison/Flex debug

You can download the source code here

PLY
The second test I did was using PLY, an implementation of lex and yacc parsing tools for Python. Being implemented entirely in python it should be much more slower that pybison, but I didn’t find any difference with the pybison parser version. In fact PLY , like the traditional bison, creates tables starting from the grammar syntax.
Ok, Both of the implementations are slower that the pure C parser, but extremely faster that antlr!
(They took more or less 0.02 to 0.5 secs for parsing and generating the AST.)
Unlike pybison PLY is still mantained and offers more features and a better error handling.. even if the whole grammar has to be rewritten in python, and it can be compiled in Windows too.

To run the test just write:
python run.py {filename}
P.S. Unfortunately the yacc parser isn’t yet complete because I still need to find a way for parsing correctly E4X and XML syntax..