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

  • Home
  • SEARCH
  • 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 6535613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:23:38+00:00 2026-05-25T10:23:38+00:00

I have various components that are skinned through a programmatic skin. The skin class

  • 0

I have various components that are skinned through a programmatic skin. The skin class references a singleton class that holds various colors to be applied to different aspects of the component. The singleton class has default colors set to variations of black/grey etc. I’m loading in custom colors from an XML file that are then loaded into the singleton. I’m applying the custom skin through a css stylesheet that is included in the main Application mxml.

The problem is that when the swf initially loads, the components that are drawn on screen are black and don’t reflect the changes in color loaded from the XML file. I have some dropdown windows that show on button clicks and those dropdowns do reflect the correct colors from the XML file. Therefore, the system is working correctly, but the initial drawing of components obviously happens before the XML is loaded and applied to the singleton.

My question is, is there a way to apply a skin to an element programmatically by calling the constructor?

I have this in my css file:

.PanControlsBackground {
    borderSkin:ClassReference('skins.buttons.PanControlsBackground');
}

and I’m applying the class with this:

_app.panControls.styleName = "PanControlsBackground";

Is there a way to call:

_app.panControls.styleName = new PanControlsBackground();

or something to that effect? This way, I can remove the loading of the skins in the css file and control when they are instantiated to ensure that the correct colors are applied before displaying the various components.

  • 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-05-25T10:23:38+00:00Added an answer on May 25, 2026 at 10:23 am

    You could use the styleManager to manipulate the style at run time. For example,

    .PanControlsBackground {
      /* leave it blank */
    }
    

    And then in some script block:

    styleManager.getStyleDeclaration(".PanControlsBackground").setStyle("borderSkin", skins.buttons.PanControlsBackground);
    

    So, that’s one way of changing the skin in a programmatic way.

    However, I don’t know much about how the garbage collection is handled on the old skins. For instance, how would the GC differ on this method of switching the skin versus just having a bunch of different CSS classes for each of your skins and switching between them? I can’t really answer that.

    I think one could at least say that the above method would ensure that the default (or other minimal skin you might create) is used first, and one could control when in the initialization process the other skin get’s instantiated.

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

Sidebar

Related Questions

I have a component that is made up of various components such as a
I have a number of classes that represent various computer components, each of which
i have divided various components of the page in different php file. In the
I have a few things in various different files that get called from different
I have a component with a number of properties that have various attributes Normally
I have a JApplet which I contains various Swing components. It also starts a
We have various php projects developed on windows (xampp) that need to be deployed
We have various servers that have many directories shared. It's easy enough to look
We have various spreadsheets that employ deliciously complicated macros and third party extensions to
I have various pieces of generated HTML/JS that I load into Activity with WebView#loadDataWithBaseURL.

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.