Code efficiency and applied AS2.0

I’ll be down in SF for FlashForward from the first to the eighth, just chillin’, never illin’ (in my mouth I’ve got one fillin’). Or something like that.

While there, I’ll be doing an Ask The Expert session on “Applied ActionScript 2.0”, which I’ll be leading off with a quick talk on the 5 most important changes in 2.0, and how they impact developers.

I’ll also be speaking at the SFMMUF meeting on Friday (the 5th) on “10 Tips for Writing Efficient ActionScript”. From the session description: “In this session, Grant will share 10 tips for improving the efficiency of your ActionScript code, and take a look at how to measure code efficiency.”

I expect I’ll probably blog some of the materials from my sessions after the conference, so stay tuned (I really need to get back to blogging, but I’ve been so busy with work, and course development).

Hope to meet up with some of you there.

Flash MX 2004 Enterprise Development

I’ve had a lot of requests to run my Flash MX 2004 Enterprise Development workshop in locations other than my home city, and now I will be doing so, starting at the FlashInTheCan conference in Toronto. If you haven’t already, you REALLY should check this conference out – they have 80 (!) top speakers, and its always a really great time (both for learning and for fun).

On March 31, April 1 and April 2 (the 3 days preceding FitC), I will be running this intensive workshop at the conference location. It consists of 24 hours of intense instruction on Object Oriented Programming, Analysis and Design, server communication, coding standards/strategies, and application development processes. The workshop is targeted at intermediate Flash developers who want to take their game to the next level. It will consist of theory, practical examples, and a guided project.

I have been running a trial version of this course locally, and the response has been phenomenal – I’ll post some comments in the next few days.

This workshop is limited to 20 seats, and we expect it to sell out, so corner your boss (this course WILL make you more productive) and jump over to http://flashinthecan.com/ to sign up. It’s only $999Cdn (~ $750 USD) until March 1st.

For more information and pre-requisites visit the FlashInTheCan site and click my ugly mug on the right hand side, or look under the “Details” section for “Extra: Workshop”. Or feel free to send me an email (contact link at the top of this page).

Blog Vandalism… wtf?

Ok, maybe I asked for it. Over the past few days as everyone has been getting massive blog spam, I was feeling pretty smug. Since I implemented my simple spam counter-measures, I’ve received about 5 spams a week, each of which only takes about 15 seconds to delete.

I knew my system was FAR from inviolable, but I felt that it wouldn’t be worth a spammers time to work around them, when I had shown an obvious commitment to deleting spam. So far, I have been proven completely right.

Apparently though, it is worth some no-talent script-kiddy’s time to write a script specifically to junk up my blog. Today I got hit with about 2000 junk posts in about a 5 second period (yeah, should’ve updated MT earlier, but life is busy). These weren’t spam posts – they didn’t have any content other than random characters, they didn’t link anywhere – they were just pure vandalism. Some little shit giggling in his parent’s basement as he used his daddy’s computer to waste my time. Just makes you wish someone would throw a little bleach in the gene pool.

So, what is the result? Well, like everyone else, I’m disabling comments for now. I hate the fact that one moron with low self-esteem can ruin things for everyone, but I don’t have a choice until I have more time in which to update MT, and look at other solutions for countering idiocy like this.

I promise I’ll post more in February too, life has just been a rollercoaster ride.

Blah.

My Latest Project: Complete!

I recently completed a project called “Stories of Your Life”. It was a grueling, marathon project, but I learned a lot and am very proud of the results. As such, I wanted to do a little show and tell on the project, and show some screenshots of the finished product.

Handing off the final CD sure gave me a new respect for software developers. Rolling out web applications is such a forgiving process – you do testing up front, but if something goes wrong after roll-out, it is usually a fairly simple matter to correct it. Sending a CD for mass-duplication, and knowing that any problems are going to be nearly impossible to rectify is a stressful business. 🙂

Stories of Your Life is an application based around the national best-selling book Once Upon a Lifetime by Pat A. Williams. I worked directly with this lovely, vibrant woman in interpretting and enhancing her printed work for the digital medium. Briefly, it is a Windows application that guides you through recording the stories of your life with over 2000 questions in 15 categories and 78 subcategories. In addition to formatted text, you can associate photos, audio and video with your answers.

I believe it is quite unique as a retail product built with Flash, and with its amazing blend of “multimedia presentation” and “desktop application”.

The application was built using FlashMX, and ScreenWeaver. I was very happy with ScreenWeaver, with the exception of a major bug that causes a BSOD fatal exception when writing large files (as yet unfixed, but I worked around it by using a series of smaller appended writes instead). Read on for a short tour of the software.

Continue reading →

Completely Free Hosting

A friend of mine pointed me to 1and1.com, where they are giving away 3 years of free hosting to generate word of mouth promotion (like this) until Jan 21. I’ve read through some of their FAQs, and it seems legit: 500MB space, 5GB transfer, PHP, MySQL, etc – and their overflow bandwidth is cheap at 99cents/GB. They’ll even register domains for you for only $5.99/yr.

The only catch I’ve found is that you don’t receive phone support, but I don’t consider that much of a catch (who calls their host anyway?).

I haven’t signed on with them (my current host keeps me pretty happy – and supports FlashComm), but even so, I’m tempted to dream up a new domain to register with 1and1.

FF Film Festival Nominations Open

I haven’t seen anyone else blog this (though I’ve been negligent in my blog reading duties, so I probably just missed it), so I thought I should – nominations for the FlashForward 2004 San Francisco Flash Film Festival are now open. If you have any cool projects that you’ve developed recently, and would like to get your hands on a wicked-cool orange rubber arrow (I have two, brag, brag) be sure to visit the nominations page.

Class locations in AS2.0 run-time

I hadn’t really thought about where AS2.0 classes reside at run-time until I encountered a need to dynamically create instances of the classes I had made for one of my current projects. In AS1, it was really simple to dynamically create instances from a class name, because you specified where the class definition resided, for example:

// on _root
function MyClass() { };
// anywhere else:
className = "MyClass";
myInstance = new _root[className]();

However, in AS2.0, you never specify where the class definition sits – it’s really pretty obvious though, if you think about it for a moment. AS2.0 classes can be accessed by name from anywhere in the swf – they are accessible globally. This , of course, is because they reside inside of _global. For instance, if you defined a custom class called “MyClass” in AS2, you could access it at _global.MyClass, and could create instances of it dynamically with:

className = "MyClass";
myInstance = new _global[className]();

Simple, eh? So what about classes inside of packages? Well, the dot notation indicates an object hierarchy, and it turns out that’s all there is to it. The class definition for a class called “MyClass” inside the “com.gskinner.utilities” package can be found at _global.com.gskinner.utilities.MyClass. If you knew the package was always the same, you could create instances dynamically with:

myInstance = new _global.com.gskinner.utilities[className]();

If you want to create instances from full dynamic class names with varying packages, you can use this function I whipped up:

function getInstanceOf(p_fullName:String):Object {
var classPath:Array = p_fullName.split(".");
var package:Object = _global;
var l = classPath.length-1;
for (var i:Number=0;i<l;i++) {
package = package[classPath[i]];
}
var c:Function = package[classPath[classPath.length-1]];
var instance:Object = new c();
return instance;
}
// test it:
myInstance = getInstanceOf("com.gskinner.utilities.MyClass");

Unfortunately, I haven’t got it working with .apply yet, so you can’t pass arguments to the constructor (if anyone gets this to work, send it to me, and I’ll post it).

All of this raises an important consideration: Be careful of name conflicts with packages when adding items to the _global object (classes should be fairly safe due to their capitalization)! If you have a class “com.gskinner.utilites.MyClass”, and you then you define a _global.com variable, you will overwrite the entire “com” class package (Eek!). For example:

import com.gskinner.utilities.MyClass;
_global.com = 127;
myInstance = new com.gskinner.utilities.MyClass();
// myInstance is undefined!

Upcoming presos: FitC, FFSF, NAIT, UofA

I received confirmation today that I will be speaking at Flash In The Can 2004 (Toronto) in early April. I will be speaking on coding production-friendly ActionScript 2.0. Rather than rehash syntax, I will focus on how to actually apply AS2.0 to real projects in the most effective manner possible. I really feel it will be a phenomenal session, given the ramp-up I will have in the preceding speaking engagements, and the practical knowledge I am gaining from a number of projects that I have been working on.

In January and February, I will be instructing “FlashMX 2004 Enterprise-level Development” at the Northern Alberta Institute of Technology. This is a 36 hour course, spread over 4 weeks, covering advanced Flash development.

At the end of January, I will doing a guest lecture to fourth year Arts students at the University of Alberta (topic to be finalized), which I’m pretty psyched about.

In early March, I will be doing an Ask The Experts session at FlashForward San Francisco, dealing with basically the same topic as my FitC session. I will begin with a short session discussing my development techniques, best practices, and look at some real world examples; then provide attendees with an opportunity to ask questions about implementing AS2.0 in their projects. This should help provide a great foundation of really relevant material for my FitC session.

Hope to see some of you at these events. Be sure to say “hi” if you see me!