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 7723651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:29:43+00:00 2026-06-01T04:29:43+00:00

Im skinning a progressBar in Flex, and after reading a bit about it, I

  • 0

Im skinning a progressBar in Flex, and after reading a bit about it, I see that there is something called hostComponent.

Adobe site says:

"The host component is the component that uses the skin. By specifying the host component, Spark skins can gain a reference to the component instance that uses the skin by using the hostComponent property."

But, I still dont understand how this exactly works.

Any quick and practical explanation?

Thanks!

  • 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-01T04:29:44+00:00Added an answer on June 1, 2026 at 4:29 am

    When you create custom components in the Spark architecture, you usually split them up into two parts:

    • an ActionScript class that contains the core functionality of the custom component. This class will usually extend SkinnableComponent or SkinnableContainer
    • an MXML skin class which is loosely associated with that ActionScript class and contains only the visual presentation of the component. This class should contain no real functionality and it should be trivial to substitute it with another skin.

    The first of these two classes is referred to as the host component from the skin’s point of view.

    A simple example

    Let’s create a very simple panel by extending SkinnableContainer:

    public class MyPanel extends SkinnableContainer {
    
        [Bindable]
        public var title:String;
    
    }
    

    As you can see, I made a property ‘title’ which we want to use to display a title in the Panel. Now let’s create a skin that uses this property:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark">
    
        <fx:Metadata>
            [HostComponent("path.to.MyPanel")]
        </fx:Metadata>
    
        <!-- graphics for title bar go here -->
        <s:Label text="{hostComponent.title}" top="5" left="5" />
    
        <!-- graphics for panel content go here -->
        <s:Group id="contentGroup" top="30" bottom="0" left="0" right="0" />
    
    </s:Skin>
    

    The hostcomponent is defined in the ‘metadata’ block and you see that we can use it to bind its properties into our visual representation. The ‘contentGroup’ is there because it is required by SkinnableContainer; this is were all the elements will go that you put inside the custom panel. So here’s how to use it:

    <myComps:MyPanel title="Panel title" skinClass="path.to.skins.MyPanelSkin">
        <s:Label text="Hello Panel" />
        <!--everything in here goes into the 'contentGroup'-->
    </myComps:MyPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm (slowly) learning Flex 4 and working on skinning a custom component that extends
I'm skinning scrollbar in my flex app and got one problem. This white square
The Delphi XE2 skinning option is fantastic, but there are cases where you want
I am skinning a 3rd party app that has no HTML natively. It all
I was just skinning a website and found that overflow:visible renders two completely different
I've been asked to suggest some performance improvements for a site that uses JSF/Richfaces/Seam/A4J.
I am writing an application that I am working on a skinning feature to
I've been learning Degrafa recently, and I have noticed that there is not much
I'm skinning a Flex app and I want the graphics to be vectors. I
I've just started playing about with skinning and am finding it harder than anything

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.