At my part time job with Pearson, I’m a member of a team that maintains a large template system for e-learning projects. This template system allows us to produce very large media-rich courses in a relatively short span of time. In these projects, as well as others, I try to teach and maintain a system of adding features, rather than bandaging functionality that needs to change. When a client request comes in, I challenge myself and my colleagues to consider how this request could be made part of our permanent (and ongoing) system, rather jury rigging the current system to temporarily support new functionality. This feature-based approach has several long-term advantages that I will elaborate on this post.
(more…)
We’re giving away a copy of Animation with Scripting for Adobe Flash Professional CS5 Studio Techniques, the book co-authored by Flash character animation guru Chris Georgenes and myself (and tech edited by AJ).
Animation with Scripting is an intermediate-level guide that covers a gamut of Flash animation topics in step-by-step detail, including: lip-syncing, walk cycles, visual FX with ActionScript, controlling a character with ActionScript, building an online portfolio, publishing to mobile devices, and automating tasks in Flash.
This is your chance to get your hands on a free copy! Find out how to enter below…
Ways to Enter:
- Tweet about this post. 1 point
- Post a comment on this entry. 1 point (Be sure to include your email address, it won’t be shown publicly, but we will use it to contact you if you win)
- Subscribe to our newletter. 2 points
- Blog about this post. 2 points
If you choose all 4 options, you’ll have 6 chances to win.
The winner will be announced on Monday, April 25th. Good luck everyone!
If you’re interested in this book, you might also be interested in Chris’ How to Cheat in Flash books.
Update (4/25/11): The competition is now closed. Congratulations to Cécile for winning the giveaway! Thanks to everyone for entering! Honorable mention to Alexis for also upping his chances by earning all 6 possible points!
I’m working on a new desktop (Adobe AIR) application. More on that app in the months to come. In the process of putting together a prototype, I’ve found that NativeMenu.getItemByName doesn’t work (at least not on my system). I initially used the following code to try to add a menu item to the File menu:
var nm:NativeMenu = NativeApplication.nativeApplication.menu;
var nm0:NativeMenuItem = nm.getItemByName('File');
var mi:NativeMenuItem = new NativeMenuItem("Export...");
mi.addEventListener(Event.SELECT, exportSelected);
nm0.submenu.addItem(mi);
Unfortunately, the menu item resolves to null in the above code and subsequently generates an error. Instead, I’m using the following code (that works):
var nm:NativeMenu = NativeApplication.nativeApplication.menu;
var nm0:NativeMenuItem = getMenuItemByLabel(nm, 'File');
var mi:NativeMenuItem = new NativeMenuItem("Export...");
mi.addEventListener(Event.SELECT, exportSelected);
nm0.submenu.addItem(mi);
The getMenuItemByLabel function is as follows:
function getMenuItemByLabel(menu:NativeMenu, labelName:String):NativeMenuItem {
var count:uint = menu.items.length;
for(var i:uint=0; i < count; i++){
var item:NativeMenuItem = menu.getItemAt(i);
if(item.label === labelName) return item;
}
return null;
}

That way I can get the menu by name and rest assured that I’ve added to the File menu (or any other existing menu) without having to guess its index.