Been a long time posting! I guess you can put it down to being busy busy, but probably also due to lack of creative juices (beer?). I’ve found that I maybe underestimate my free time when it comes to my personal projects, and that I take on too much.
Case in point.. I’ve been working on an AS2 component set now for over a year and a half. I took a look at it the other day and its still missing some features, like you still can’t skin with bitmaps (an essential feature!). Anyway, I started going over the API, standardizing method names, documenting, and making things private that shouldn’t be public. I would like to convert them to AS3 pretty soon, because I still think there are some pretty cool aspects about them that people might find useful.
So look forward to that in 2009!
In the meantime, I’ve been following the progress of both Sandy and Papervision3D. Both engines are making great steps to cool 3D stuff in flash, and I’ve started using papervision for a small 3D game idea (think Rez).
Also, Joa Ebert is doing some really awesome stuff with image processing, and also experimenting with the Wii remote. This is interesting to me having just acquired a Wii console (those things are hard to find!). I’ve inserted his blog into my regular blogroll.
ByteArray.org has some interesting low-level AS3 stuff, definitely worth checking out.
I really need to get back into making fun stuff in flash!
I finally have the chance to work on a real-world Actionscript 3 project (yeah, its been a long time coming). I realise that this post may be old news (and really pointless) to a lot of you, but I decided to write about things that weren’t immediately obvious to me while learning AS3.
The Loader class doesn’t dispatch events, but Loader.contentLoaderInfo does.
If you take a look at the API documentation for Loader.load(), you’ll notice that the different events dispatched after a load operation are listed, which lead me to think that the loader itself dispatches them. The fact is that you actually need to add your event listeners to Loader.contentLoaderInfo as shown in the example on that page.
In order to use flash.utils.getDefinitionByName(), your class has to actually be compiled into the swf.
Well, duh. Flash player will throw an error if it can’t find your class. This is easily solved by including a reference to the class in your source code somewhere. private var myClass:Class = com.package.to.MyClass;
Removing a particular item from an array is easier! array.splice(array.indexOf(obj),1);
Copying attributes of an xml node into an object is.. different. var o:Object = new Object();
for each (var z:XML in node.@*)
{
o[String(z.name())] = z;
}
You can check if a DisplayObject is actually attached to a display list by checking the stage property.
If the stage property is null, it isn’t attached. This might seem obvious but if you’re trying to find out why something isn’t showing up.. the reason could be that you forgot to actually attach it with addChild().
In Flex Builder’s Actionscript 3 projects, mx classes aren’t immediately available.
You need to add the mx framework.swc to the project under Project->Properties->Flex Build Path->Library Path (tab)->Add SWC.. (button). The file is located at: ${FRAMEWORKS}/libs/framework.swc.
AS3 base types don’t always default to null.
Variables of certain base types such as Boolean and int are no longer ‘undefined’ when declared. This means you can no longer perform checks such as: if (myBoolean == undefined) doSomething(); since boolean values default to false.
You can find a list of default values on this page in the documentation.
A couple of weeks late posting this (been busy!), but I am very happy to report that I’m now an employee of Schematic, working out of their new Boston office with some very talented people.
After being mostly in the education industry for 5-or-so years, I’m looking forward to creating stuff that might be a little more exciting (and a little more visible)!
I went to my first Boston Flash Platform User Group (BFPUG) meeting last night. Met some interesting people whose names I’ve seen before. But now I have faces to put with those names.
On August 23rd, Ted Patrick is flying in all the way from the Adobe mothership to give a talk on Flex.. so I’ll definitely be there for that one.
So, if you’re in or around Boston and even remotely interested in Flash, why not come along?
Flash player 8 is required to see the movie below.
This is a small preview of a subset of components from my ‘Razor’ component framework.
I know you’re probably wondering why the world would need another set of components for Flash. But I think they are a tiny bit special in the fact that you don’t need the Flash IDE, the mx framework, or even a library of symbols to compile. The example shown below was compiled with mtasc only.
They are targeted for the kind of developer that tends to design forms using actionscript rather than the IDE, and they are designed to save time when creating your UI. They are also designed to be as configurable as possible if you choose to delve into the code, but as simple as possible if you don’t.
I’m still busy completing the set and squashing those annoying niggly bugs, but I hope to have them available soon.
The bad news is that the license probably won’t be free although I’m still figuring that part out
The top three buttons change the style to a different preset (defined in actionscript).