FlashBuilder/Spark :: Mobile Project :: Change color of button in view actionbar

FlashBuilder/Spark mobile project view action bar.

Currently if you set the chromeColor of a button in the actionbar it only shows up when on the press state of the button. It does not change the color of the button default state. I could not find any way to style it.

Answers


After some digging I found that TransparentActionButtonSkin.as was overriding the drawBrackground function and specifically removing chromeColor and only allowing it to show on a the button down state.

I overrode that "little gem" with my own class.

package view_components
{
    import mx.core.mx_internal; 
    import spark.skins.mobile.TransparentActionButtonSkin;

    use namespace mx_internal;

    public class ActionbarColoredButton extends TransparentActionButtonSkin
    {
        public function ActionbarColoredButton()
        {
            super();
        }

        override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
        {
            // omit super.drawBackground() to drawRect instead
            // only draw chromeColor in down state (transparent hit zone otherwise)

            //NO, I want colored action buttons
            var chromeColor:uint = getStyle(fillColorStyleName);
            var chromeAlpha:Number = 1;

            graphics.beginFill(chromeColor, chromeAlpha);
            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
            graphics.endFill();
        }
    }
}

Need Your Help

Check if my pages are cached

javascript jquery html5-appcache cache-manifest manifest.cache

I have a page that links to a manifest file. The manifest file has many urls in it. Usually it takes a few minutes to load everything.

mail using PHP send a image tag

php

The following header informations I have added to send a html content as a mail message.