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…

mxmlc NullPointerException crash

Today I was getting crazy to find out why Flex didn’t want to compile my application.. Clicking on compile it started suddenly to give me an internal compile error and nothing else. So i tried to compile with the mxmlc from a console just to see the error log and the outpuw was:
java.lang.NullPointerException
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:891)
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:890)
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:891)
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:890)
at macromedia.asc.parser.BinaryExpressionNode.evaluate(BinaryExpressionNode.java:38)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:962)
at macromedia.asc.parser.ListNode.evaluate(ListNode.java:27)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:5859)
at macromedia.asc.parser.LiteralXMLNode.evaluate(LiteralXMLNode.java:28)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:3087)
at macromedia.asc.parser.VariableBindingNode.evaluate(VariableBindingNode.java:48)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:962)
at macromedia.asc.parser.ListNode.evaluate(ListNode.java:27)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:2897)
at macromedia.asc.parser.VariableDefinitionNode.evaluate(VariableDefinitionNode.java:32)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:4629)
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:86)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:938)
at macromedia.asc.parser.ArgumentListNode.evaluate(ArgumentListNode.java:28)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:750)
at macromedia.asc.parser.SetExpressionNode.evaluate(SetExpressionNode.java:39)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:580)
at macromedia.asc.parser.MemberExpressionNode.evaluate(MemberExpressionNode.java:31)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:1273)
at macromedia.asc.parser.ExpressionStatementNode.evaluate(ExpressionStatementNode.java:33)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:4407)
at macromedia.asc.parser.ClassDefinitionNode.evaluate(ClassDefinitionNode.java:86)
at macromedia.asc.semantics.FlowAnalyzer.evaluate(FlowAnalyzer.java:2577)
at macromedia.asc.parser.ProgramNode.evaluate(ProgramNode.java:63)
at flex2.compiler.as3.Compiler.analyze2(Compiler.java:436)
at flex2.compiler.mxml.InterfaceCompiler.analyze2(InterfaceCompiler.java:337)
at flex2.compiler.mxml.Compiler.analyze2(Compiler.java:130)
at flex2.compiler.API.analyze(API.java:2360)
at flex2.compiler.API.analyze(API.java:2275)
at flex2.compiler.API.batch2(API.java:337)
at flex2.compiler.API.batch(API.java:1025)
at flex2.compiler.API.compile(API.java:1211)
at flex2.compiler.API.compile(API.java:1114)
at flex2.tools.Compiler.main(Compiler.java:222)

Wow!!
So, how can I find the problem? I can’t find any useful information from this log..
For this reason I had to remove portion of code from my mxml and from all the imported packages.. 2 hours of “debugging” gave me the solution!

A syntax error in a declaration of an XMLList was the problem!  Fixed the line also the compiler started to run again with no problems.

This is a portion of mxml code to reproduce the problem:
;

< ![CDATA[ private var uuid:String = ""; private var menubarXML:XMLList = <>
<>;
]]>

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…

Google Talk Gadget

Google team just announced a new gadget available for google personal homepage: Google Talk Gadget.
Basically it’s a flash version of the Gtalkr application. It has a lot of features such as share YouTube videos or Picasa WebAlbum pictures…

Does this mean that the google crew has started to look at flash more that in the past? Maybe a new way to remove the “beta” to all its AJAX apps?
Probably also thanks to the linux flash player 9 recent release?

Read the full post here: http://googletalk.blogspot.com/…/google-talk-gadget.html

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 ); } } }