Try putting a breakpoint in SystemManager's
installCompiledResourceBundles() function. That's where the resource
bundles are set up.

It's possible that your class is being loaded before the resource
bundles are set up, and that's why you're getting null.

Manish

On Tue, Jun 2, 2009 at 5:08 AM, Tim Rowe <[email protected]> wrote:
>
>
> I'm trying to resolve an issue whereby we have a heap of structures defined
> in static arrays, and one of the params is a string of text.  Ideally this
> string would come from a resource bundle to allow localization on the
> string.
>
> The problem is that though I've tried a variety of methods, I cannot get any
> resouce bundle values into this variable.
>
> Effectively the code I have is
> public static const foo =
> ResourceManager.getInstance().getString('myBundle', 'myKey');
> Although it's a little more glammed up than that (but I've tried it in this
> basic form). In the attempts I've gone as far as to even try having a
> utility class which calls out to a singleton, but even within that singleton
> when accessed via a static all values and ResourceBundles from
> ResourceManager come back as null values.
>
> None of the other mxml elements seem to have issues reading the same
> resource bundle - when addressed via @Resource(bundle='foo', key='bar') and
> similar they all find the values in the .properties file just fine.
> Unfortunately the nature of these variables makes it highly preferable
> they're left as statics, though it is beginning to appear that might not be
> viable.
>
> Would anyone have any suggestions on this?  It's not the first time I've had
> this problem, but last time we just gave up trying from memory.  Is it just
> a case that the ResourceBundles aren't loaded and accessable at the time
> statics are initialised, or is there something more simple (or perhaps more
> sinister?) going on?
>
> Thanks,
>
> Tim Rowe
> Software Engineer
> carsales.com Ltd
>
> Level 1, 109 Burwood Road
> Locked Bag 3333
> Hawthorn VIC 3211
>
> t: 03 9093 8600 (Reception)
> t: 03 9093 8757 (Direct)
> f: 03 9093 8697
>
>
> 

Reply via email to