Just posted the next Los Angeles Flex User Group event. Spread the word, tell a friend, tell a co-worker!

Spring ActionScript allows you to inject dependencies into your MXML components as they’re added to the stage. By default, it ignores any components whose namespace starts with either ‘flash.*’ or ‘mx.*’, so it only looks at your custom components. Since Flex 4 introduces a new ’spark’ namespace, you’ll need to override the default flexStageObjectSelector, which is as simple as adding this to your application context XML:

<object id=”flexStageObjectSelector” class=”com.classes.objectselectors.MyCustomObjectSelector”/>

I extended the default flexStageObjectSelector and added a few lines so that it also ignores ’spark.*’. The code for that class is below. Just drop it somewhere in your project and update the class attribute in the object tag above and you’ll be good to go. The Spring ActionScript documentation is very helpful and explains how you can extend it even further.

This Wednesday, 8/12, I’ll be giving a talk on Flex application architecture and how Spring ActionScript changes everything. Details here.