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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:30:55+00:00 2026-05-26T21:30:55+00:00

I attempted to build a Flex 4 skin for a Spark button, typical practice.

  • 0

I attempted to build a Flex 4 skin for a Spark button, typical practice. I adjusted the colors and other styles to my liking, including using dot selectors to specify alternate colors and such during different states. However, these are all ignored when the button is disabled. Regardless of what I do, in the disabled state, my button always has the wrong color and is alpha’d to 0.5 (even if I specifically state that alpha.disabled=”1″). All the other skin states work as expected. What is going on here?

This is my custom skin. If it were working correctly, it would appear to have no shadow or highlight, and would be a gradient grey color. Instead, it appears as a 50% alpha version of the up state (shiny green).

<?xml version="1.0" encoding="utf-8"?>
<s:SparkButtonSkin xmlns:fx="http://ns.adobe.com/mxml/2009" 
             xmlns:s="library://ns.adobe.com/flex/spark" 
             xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
             minWidth="21" minHeight="21" alpha.disabled="1">

    <fx:Metadata>
        <![CDATA[ 
            [HostComponent("spark.components.Button")]
        ]]>
    </fx:Metadata>

    <s:states>
        <s:State name="up" />
        <s:State name="over" />
        <s:State name="down" />
        <s:State name="disabled" />
    </s:states>

    <s:Rect id="backgroundAndShadow" left="0" right="0" top="0" bottom="0" radiusX="5" radiusY="5">
        <s:filters>
            <s:DropShadowFilter blurX="5" blurY="5" blurX.down="3" blurY.down="3" alpha="0.5" distance="1" distance.down="0" angle="90" excludeFrom="disabled" />
        </s:filters>
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color.up="#00AD00" color="#007A00" color.disabled="#cccccc" />
                <s:GradientEntry color.up="#29FF29" color="#00F500" color.disabled="#bbbbbb" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect>

    <s:Rect id="highlight" left="1" right="1" top="1" height="50%" topLeftRadiusX="4" topLeftRadiusY="4" topRightRadiusX="4" topRightRadiusY="4" excludeFrom="disabled">
        <s:fill>
            <s:LinearGradient rotation="90">
                <s:GradientEntry color="#ffffff" alpha="0.8" />
                <s:GradientEntry color="#ffffff" alpha="0.3" />
            </s:LinearGradient>
        </s:fill>
    </s:Rect>

    <s:Label id="labelDisplay"
             textAlign="center"
             horizontalCenter="0" verticalCenter="1" verticalAlign="middle"
             color="#ffffff" color.disabled="#555555"
             fontWeight="bold"
             left="2" right="2" top="2" bottom="2">

        <s:filters>
            <s:DropShadowFilter blurX="3" blurY="3" alpha="0.5" distance="1" distance.down="0" angle="90" excludeFrom="disabled" />
        </s:filters>
    </s:Label>

</s:SparkButtonSkin>

I also did this with an automatically generated skin for the Button using Flash Builder’s skin creation wizard/dialog. Even then, specifically setting the alpha to 1 in disabled mode had no effect.

Edit
This is the code used to create and then disable the button:

_action1Button = new Action1Button();
view.actionGroup.addElement(_action1Button);
_action1Button.enabled = false;

The error was that _action1Button is not the actual button, rather, it’s the container of the button. Doh! Switching it to _action1Button.actionButton.enabled = false; fixed the issue.

  • 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-26T21:30:56+00:00Added an answer on May 26, 2026 at 9:30 pm

    Your skin works fine for me. I get a green button in the enabled state then a grey gradient without drop shadow when enabled is false. I tested it like this (where TestSkin is your skin posted above):

    <s:Button skinClass="TestSkin" enabled="false" />
    

    I assume the problem has to do with how you are using the skin. Can you post the code where the button itself is defined?

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

Sidebar

Related Questions

I have a project where we are trying to skin Spark components from a
I got this error when macport automatically attempted to compile it Error: Target org.macports.build
I'm attempting to build mercurial 1.3.1. I've attempted this thus far on my Mac
I just upgraded to the latest Xcode version(3.2.5) and attempted to build and run
So I attempted to build what I asked about in this question: Fix voting
I have attempted to start programming with OpenGl using this tutorial , and have
I'm trying to build a collapsible panel in Flex 4. I thought I'd use
I have attempted to build a level system for my users in php. So
I currently have Xcode 4.1 installed. I attempted to update using the App Store
I was following http://code.google.com/p/dart/wiki/BuildingDartium#Build and attempted to build dartium in Release mode and encountered

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.