mxdu
You gotta love the Ozzy sense of humour. Ok Geoff, I am late submitting my bio - you made your point. I can't top that one, so it looks like its going to have to stay! I'm just glad I managed to send them a photo, before my charicature is drawn...
excluding classes
The Flash MX 2004 compiler is very clever, in that it notices that you are using a class and will compile it into your SWF, without you having to tell it to do so. The only problem is that sometimes one class will make references to other classes in methods that you know that you aren't going to use. The compiler cannot guarantee that you aren't going to use those classes, so they always go in there. This can make your SWFs unnecessarily large. Other times, you may be using the same classes in multiple SWFs, which will be loaded into the same base movie, so you wouldn't want the classes included in both.
Luckily Macromedia have provided a solution. You can explicitly exclude classes, using a special XML file, which must be in the same directory as the FLA. The file must be named yourFlaName_exlude.xml, so if your FLA is called coolApp.fla, you would name the file coolApp_exclude.xml. Here is what the file should look like:
<excludeAssets>
<asset name="mx.controls.Button"
/>
<asset name="mx.controls.CheckBox"
/>
<asset name="mx.managers.FocusManager"
/>
</excludeAssets>
This is still awkward because you will have to test pretty carefully which classes are safe to exclude and which will affect your app. For example, excluding FocusManager will not break any of the components, but it will affect the tabbing and make them look tab-focused when you click on them. The other thing to watch is that dependent classes may still be compiled, even if they are only referenced by an excluded class. This can make it a real pain to do because you have to find out which they are and also that they are not needed by some other class, that you do want.
Perhaps someone will come up with a nice set of excludes for different predefined scenarios - that would be really helpful. Or, even better, make an authoring extension, which lets you exclude classes by ticking boxes. That would be great! (anybody?)
try, catch, finally
A couple of people have been asking me about when to use the finally
keyword. try and catch are fairly obvious; you try
a bit of code out - if an error is thrown then you catch it in the corresponding
catch block, otherwise carry on normally. finally
is less clear:
function myFunction () : Boolean {
try {
doSomething();
} catch (e:MyError) {
doSomethingSafe();
} finally {
return true;
}
}
In that example, if return true was not in a finally
block and an error was thrown and not caught, nothing would be returned. Code
in a finally block is always invoked, even if there are uncaught
errors. Code that is simply placed after the catch would not be
invoked if there was an uncaught error because that would make the function
bail out immediately. So that's it really - use finally, to have
code execute even if there are uncaught exceptions.
peterjoel is typing a lawsuit...
All the big companies seem to have patents on pretty much everything. It seems like every type of functionality, no matter how obvious, can be labelled as a "technology" and patented. The Eolas vs Microsoft fiasco is just one example, but most things you take for granted (and are used by lots of diferent pieces of software) are patented by someone, and most likely one of the big players. For example Microsoft were recently granted a patent on the feature of their instant messaging service, that informs you when the person you are talking to is typing. Yahoo IM, AOL's AIM and Macromedia Breeze Live all incorporate this feature. Of course, by purchasing ICQ, AOL hold the patent on the "technology" of instant messenging itself, so a counter-sue would be inevitable if Microsoft tried anything with them.
Wank on Hitler
Apparently Amazon edit readers' reviews, but certain terminolgy obviously gets lost in the translation from one side of the Atlantic to the other.
Notably, most of the reviewers for this item are from UK and amazon.co.uk does not feature any reviews for it...
