A few days ago I had posted Apple, Adobe, Flash, iPhone, iPad and Open Source with reference to a debate on various blogs. The debate is whether Flash will ever go open source, should they, and what it means to the Apple / iPhone / iPad contingent.
Learned about a promising library for Actionscript 3 today, Casalib. There will be more information about the library, as I’m just starting to get to playing with it.
Something that has been pissing off recently, has been the lack of ability to easily reference the stage from any object in AS3. I find myself building controllers to manage objects in the stage, and I have to play tricks with passing objects around. Why I haven’t written a class to access the stage is beyond me.
In looking at the blog for Casalib, I saw a post Get Access to the Stage Wherever You Need It.
I’ll quote the article below:
In ActionScript 2, it was possible to access the stage from anywhere, through the static Stage class. With ActionScript 3, we lost that ability, and only display objects were permitted access—and only once they had been added to the stage.
To help you get access wherever you need it, CASA Lib for AS3 has a utility class called
org.casalib.utilpackage. It’s a static class that lets you keep track of the stage (or multiple stages if you’re developing an AIR app with multiple windows). Here’s how we recommend using it.
In the constructor of your main document class, just call this line of code:StageReference.setStage(this.stage);
Now, throughout your entire site or application, you can get access to the stage reference from anywhere by using this line of code:StageReference.getStage();
I’m doing some research into what other people use as their desired AS3 package/class structure.
In reading a handful of articles and reviewing some code, I ran into the following post:
- AS2 has a flexible approach to packages
- AS2 package names are more closely associated with the location of the FLA
- AS3 requires full use of packages if you want to use classes or objects
- AS3 requires the use of “public” as a definition of scope
So far so good with Papervision3D. It took me a few hours but I’m already mostly up and running with the new framework.
Later on I will post each step that I made in working with Papervision3D.
When I learn a new framework I like to learn each of the basic tools first in their entirety. It helps later on when dealing with more complicated ideas.
Along the way I’ve run across a few extremely useful sites:
- Mad Vertices – Jim Foley’s Brain. Flex, Flash, Papervision 3D, Swift 3D and other cool stuff.
- InsideRIA – Useful blog touching on more complex flash / actionscript 3.0 issues
- EverydayFlash – Creative use of technology. A blog about 3D Flash and Actionscript by Bartek Drozdz
Among us flash web developers, who hasn’t tried creating a 3D engine of their own before?
I think it’s par for the course for any flash programmer who has taken linear mathetmatics or 3d coding classes at some point in our histories.
At that point it was mostly implementing ray tracers, DirectX 3D transforms and other basic 3d manipulations (stick figures, kinematics, reflectivity, etc.).
Flash has been much more “complicated” as it were. Given the processing limitations it’s always been a game of artifically implementing 3D effects, as opposed to creating a real 3D engine.
I’ve followed Papervision3D for a while now, watching as site after site wins awards.
The most interesting thing, is that the sites that win awards for implementation of Papervision3D don’t implement extraordinarily complex 3d sites (at least so it seems, maybe that’s the magic) but artfully integrate a 3d engine into their experience:
- Barcinski & Jeanjean – I love the unique “loader”, as well as simple early interactions to allow for loading, while the user doesn’t think loading is going on.
- Fat-Man Collective – A great website fully integrating a 3d engine with design, seamless, simple, and very effective.
- 13Flo – Ignore everything you think a website had to be, just take a look at this.
Results will be posted here.