This is awesome. Here is a polished board game with nice graphics and sounds - full AI - and best of all, the complete source. This is a great example of PureMVC in action. All of the projects on Actionscript Notes utilize PureMVC, and the owner seems to be generous with the source. Many thanks for that.
Archive for March, 2008
Here's the full list of what he has on Google Code.
The CoreLib is essential, but he's been busy writing useful libraries for AIR. I've used the notification library, which has some great features and makes notifications on the desktop sensible. The exchange library is interesting, for sure. They are all worth checking out.
There are also a number of interesting example applications using AIR, including a motion detection application, an Amazon S3 interface, a screen saver, and an MS Exchange calendar.
Yes, I know I am late to the party. I can't even estimate how many times I've read a definition of an Interface over the last year. It has been a concept that totally baffled me for a long time, then I sorta understood, and last night I actually implemented an Interface intentionally and correctly. The same is true for the term polymorphism. I can read definitions until my eyes hurt, but until I actually use it, the words are just abstractions. These two concepts are synonymous, as Interfaces in Actionscript 3 are a convenience for type-checking polymorphism in APIs.
'Ah-ha!'
In this case, I had a Flex container that I wanted to pass to a method. I didn't know what the container would be, but I knew that it would be a container. IContainer? Yup. Now the method couldn't care less what class is being passed its way, as long as it has the appropriate methods that match the IContainer signature.
Now it makes sense. This is the reason I keep reading that I need to use implicit getters and setters with private class properties instead of public properties. Public properties are not allowed in an interface, so you aren't able to abstract these properties with an interface. Getters and setters ARE allowed in an interface, so now you can expose these properties and ensure that methods expecting the interface get what they are looking for. As it turns out, people weren't recommending this simply to get me to write extra lines of code
The pieces are starting to come together. Abstract classes, design patterns, polymorphism, interfaces... PureMVC has been a help. The framework pushes me towards proper OOP and the use of design patterns. Stacking knowledge, one block at a time.
Rogue Development's ObjectHandles is a great component. It is simple to use and provides all of the functionality that I was looking for in a transformation modifier. Prior to implementing this, I was using the TransformTool from senocular.com's library. This is also a great utility, but it wants to scale my content, and that was a deal breaker in my current project. ObjectHandles does NOT resize the child components. There are use cases for both approaches, but ObjectHandles allows me to decide when to scale.
<?xml version="1.0" encoding="utf-8"?> <ObjectHandles xmlns="com.roguedevelopment.objecthandles.*" xmlns:mx="http://www.adobe.com/2006/mxml" allowRotate="false" objectMovedEvent="objectUpdatedHandler( event )" width="{image.width}" height="{image.height}" > <mx:Script> <![CDATA[ import com.roguedevelopment.objecthandles.ObjectHandlesMouseCursors; public static const CHANGE:String = "imageBoxChanged"; private function objectUpdatedHandler( event:Event ):void { dispatchEvent( new Event( CHANGE, true ) ); } ]]> </mx:Script> <mx:Image id="image" source="@Embed(source='/assets/cower.png')" /> </ObjectHandles>
I spend a lot of my time animating horrific accidents. It's a great way to make a living - once you get past the original reference pictures. The above is from a case that recently cleared. Watch your speakers, it has audio.

