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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:04:14+00:00 2026-05-29T11:04:14+00:00

?Problem is pretty simple, I extend Button to create ImageButton, and I extend ButtonSkin

  • 0

?Problem is pretty simple, I extend Button to create ImageButton, and I extend ButtonSkin to create ImageButtonSkin. But, when I define hostComponent like this:

public var hostComponent:ImageButton

I get an error that there is a conflict with hostComponent:ButtonBase inside the ButttonSkinBase.

How do I extend a skin AND provide a new hostComponent for it?

  • 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-29T11:04:15+00:00Added an answer on May 29, 2026 at 11:04 am

    How do I extend a skin AND provide a new hostComponent for it?

    Why do you have to? the hostComponent is a ButtonBase, which is something your ImageButton extends. Why do you need to change the type of the hostComponent? If you need to access the hostComponent as an ImageButton, then you can cast it:

    var myImageButton : ImageButton = hostComponent as ImageButton;
    

    In the comments to this question, you said:

    So, you can extend the skin, but you can only
    use it for the component that the parent skin specifies, amazing.

    That shouldn’t be true at all. You said yourself your hostComponent has a type of ButtonBase, but you are extending the ButtonSkin. By your statement, you would not be able to use the ButtonSkin on a Button component, only on ButtonBase component. That is not true.

    I’ll also add one clarification to @RIAstar’s comment about metadata. Metadata is used only for code hinting and MXML parameter checking by the compiler. You can easily create a style w/o either of those. You’ll just have to set the value using the setStyle method:

    myHostComponent.setStyle('myImageColor',0x000000);
    

    And you can use it in the skin like this:

    this.getStyle('myImageColor');
    

    I think–but am not sure–you can also set the style via CSS even though metadata is not declared. With use of the Spark Component lifeCycle, It should be perfectly possible to set a style before the component initializes its’ styles.

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

Sidebar

Related Questions

This seems like a pretty simple problem, but I'm looking for a short and
The solution to this problem is probably pretty simple, but I need some help.
My problem is pretty straigtforward explained : if I do this : public class
My problem is perhaps pretty simple, but I just started programming in C#. My
Guess this is a pretty simple problem. I've got a regex and php that
I've got a pretty simple problem, but I've become clueless on what is causing
I have a pretty simple problem, but right now can't seem to see the
been searching everywhere, but couldn't the correct answer. the problem is pretty simple: i
This problem is pretty simple, I think. The thing is: My TextView (Which is
Pretty simple problem, but am having trouble finding the answer. Not sure what is

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.