foomonger's blog

Tips and Musings on Software Development, Flash, and Flex

Archive for the ‘resource manager’ tag

foomonger-swizframework Updated With Swiz 1.0.0 RC1

without comments

Swiz 1.0.0 RC1 was recently released so I've updated my custom metadata processors to work with it. Head over to Google Code to check out [MediateSignal] and [Resource]. Happy coding...

  • Share/Bookmark

Written by Sam Ahn

May 23rd, 2010 at 2:26 am

Swiz, ResourceManager, and [Resource]

with one comment

I'm using the Swiz Framework in a side project which requires runtime loading of all the copy. I decided to use Flex's ResourceManager by parsing static XML files and populating the ResourceManager with the newly created ResourceBundles. Binding resources into view's wasn't too bad, but it could be better. For one thing any component that needed a resource included a ResourceManager dependency. So I thought about it and then created a ResourceProcessor which really cleans things up.

Here's an example application:

I set up the [Resource] tag to mirror the @Resource directive. All you do is decorate a property like so:

[Resource(key="title", bundle="example")]
[Bindable]
public var title:String;

The processor binds the resources so they will update when binding events fire in the ResourceManager. And you only need to include a ResourceManager dependency if you are adding resources at runtime or changing the locales array.

This processor is available in my foomonger-swizframework project on Google Code. Enjoy!

  • Share/Bookmark

Written by Sam Ahn

March 10th, 2010 at 1:48 am

Posted in flex

Tagged with , , ,