Wednesday, December 20, 2006

Apollo, 3d

Apollo is definitely looking very cool. Some interesting tidbits are a video I found are here: http://weblogs.macromedia.com/mesh/archives/2006/12/mark_anders_on.html#more

Another cool looking 3d engine is going to be papervision which is definitely the coolest actionscript 3 3d engine I've ever seen: http://www.papervision3d.org/demos/seahorse

Another neat thing about engines is the fact that they take control of the speed of actionscript 3 which is about 10 times faster than as 2.

Tuesday, December 19, 2006

Inversion of Control with Actionscript

One thing that is really cool is using inversion of control design pattern from the j2ee catalog. You can use this to create some extremely re-usable classes. One thing that is a bummer is that you cannot use a class unless that class is compiled into the class itself.

One thing I did as a workaround is the following:

1. Include the bean package from the www.as2lib.org
2. Compile the class by doing something like in the root of the timeline:

public var class:AClassName;

This then gets compiled into the swf.

3. Load in the swf at runtime and once it is loaded the full class name say it was something like
net.test.MyClass would now be available in the global class path.

4. Now use as2libs bean parser:

public function loadContextXML( contextXMLPath:String, aLibraryId:String ):Void {
Logger.log("DEBUG", this + "loadContextXML() " + contextXMLPath );
this.libraryId = aLibraryId;
beanDefinitionParser = new UiBeanDefinitionParser();
applicationContext = new LoadingApplicationContext(contextXMLPath, beanDefinitionParser );
applicationContext.addListener(this);
applicationContext.start();
Logger.log("DEBUG", this + "loading batch context ["+applicationContext+"] " );
}

5. Now this runs the xml with bean definitions similar to spring and instantiates all of the classes:





device 1
device 2




6. Because the definition of the .net.test.MyClass is instantiated after the SWF that gets loaded it is now accessible through the swf that loaded in the classes.

7. This then makes it very reusable because you can compile external libraries in SWFs and then load them in at runtime and then access them using as2lib's spring factory framework.

- Code warrior

Monday, December 18, 2006

Welcome to my new actionscript blog

Welcome to the ultimate actionscript blog. This is going to be the premiere flex and actionscript tips and tricks to the ultimate tricks, graphics and cool posts.