Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7832057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:01:04+00:00 2026-06-02T12:01:04+00:00

As the title says, is there a way to alter the ResourceManager’s getStringArray() in

  • 0

As the title says, is there a way to alter the ResourceManager’s getStringArray() in a way that it splits the resources by semicolon, not comma?

The actual method can be found in the ResourceManagerImpl class, which can be found in in the package mx.resources.
Overriding that method would be fine, but ideally I’d like to write my own getStringArray with a variable separator, however, there seems to be no way of extending either the ResourceManager or ResourceManagerImpl class to somehow add that method.

Anyone got a clue what to do here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:01:07+00:00Added an answer on June 2, 2026 at 12:01 pm

    The problem is not that you can’t extend ResourceManagerImpl since it’s not final, but rather that you have to be able to register your implementation with the application instead of the default one. And doing this is a bit tricky.

    So first create your implementation:

    public class MyResourceManager extends ResourceManagerImpl {
    
        private static var instance:IResourceManager;
    
        static public function getInstance():IResourceManager
        {
            if (!instance) instance = new MyResourceManager();
            return instance;
        }
    
        override public function getStringArray(bundleName:String,
                                                resourceName:String,
                                                locale:String = null):Array {
            //do your stuff
        }
    
    }
    

    So we’ve overriden the getStringArray method. Notice that we’ve done the same for getInstance, because we want it to return a new instance of MyResourceManager instead of ResourceManagerImpl (we don’t have to mark override because it’s a static method). Also, you may have to write some import statements manually, because some of the classes you’re using are marked as ‘excluded’.

    Now we have to tell Flex to use MyResourceManager instead of ResourceManagerImpl. We can do this with the following code:

    import mx.core.Singleton;
    Singleton.registerClass("mx.resources::IResourceManager", MyResourceManager);
    

    The problem is that we have to do this before Flex registers ResourceManagerImpl, because you can’t override it once it’s registered. For this we need to create a custom preloader in which we do the registering (sadly, the Application’s ‘preinitialize’ phase is not early enough).

    public class RegisteringPreloader extends DownloadProgressBar {
    
        override public function initialize():void {
            super.initialize();
            Singleton.registerClass("mx.resources::IResourceManager", 
                                    MyResourceManager);
        }
    
    }
    

    Now assign the custom preloader to the application and we’re done:

    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                   xmlns:s="library://ns.adobe.com/flex/spark" 
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   preloader="RegisteringPreloader" >
    

    For further info I refer you to a fairly similar, but somewhat more elaborate answer that I wrote for a different question: Is there a way to listen for events on the pop up manager class?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

as the title says, is there a way I can have a clock that
so basically like the title says is there a way to use NSSortDescriptor to
As the title says, is there a way to make the maximum value of
What the title says. Is there a way to change intellisense settings (intellisense box
As the title says, is there any Scala library that exports functions to convert,
Title says it pretty much all : is there a way to get the
As title says, is there a way to send form when element outside of
As title says, is there any way to pull something like this up?: std::set<boost::shared_ptr<MyClass>>
As the title says, is there any way to get ahold of this information?
Basically, as the title says... is there any way to have user input directly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.