Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<?xml version="1.0" encoding="utf-8"?> <degrafa:GraphicRectangularBorderSkin xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:degrafa="http://www.degrafa.com/2007" xmlns:utils="info.joshmcdonald.barra.utils.*"> <mx:Script> <![CDATA[ import mx.states.SetStyle; import mx.core.UIComponent; //-------------------------------------------------------------------------- // // State // //-------------------------------------------------------------------------- [Bindable] private var state_disabled : Boolean = false; [Bindable] private var state_over : Boolean = false; [Bindable] private var state_down : Boolean = false; //-------------------------------------------------------------------------- // // Impl // //-------------------------------------------------------------------------- override public function styleChanged(styleProp : String) : void { super.styleChanged(styleProp); styleProxy.handleStyleChange(styleProp); } override public function set name(value : String) : void { super.name = value; var comp : String = name ? name.toLowerCase() : ""; state_disabled = comp.indexOf("disabled") >= 0; state_over = comp.indexOf("overskin") >= 0; state_down = comp.indexOf("downskin") >= 0; if (state_disabled) { filters = [new ColorMatrixFilter([0.3,0.3,0.3,0,-32, 0.3,0.3,0.3,0,-32, 0.3,0.3,0.3,0,-32, 0,0,0,1,-64]), new BlurFilter()]; } else if (state_down) { filters = [new ColorMatrixFilter([1,0,0,0,16, 0,1,0,0,16, 0,0,1,0,16, 0,0,0,1,0]), new GlowFilter(0xffffff, 0.6, 4, 4, 1.5,1,true), new GlowFilter(0,0.8,3,3,2,1)]; } else if (state_over) { filters = [new GlowFilter(0xffffff, 0.6, 4, 4, 1.5,1,true), new GlowFilter(0,1,3,3,2,1)]; } else { filters = [new GlowFilter(0,0.6,2,2,1,1)]; } } ]]> </mx:Script> <utils:StyleProxy id="styleProxy"/> <degrafa:geometry> <degrafa:RoundedRectangle x="0" y="0" width="{skinWidth}" height="{skinHeight}" cornerRadius="3"> <degrafa:fill> <degrafa:SolidFill color="{styleProxy.themeColor}"/> </degrafa:fill> </degrafa:RoundedRectangle> <degrafa:RoundedRectangle x="0" y="0" width="{skinWidth}" height="{skinHeight}" cornerRadius="3"> <degrafa:fill> <degrafa:LinearGradientFill angle="90" blendMode="{BlendMode.SCREEN}"> <degrafa:GradientStop ratio="0" color="#ffffff" alpha="0.3"/> <degrafa:GradientStop ratio="0.4" color="#ffffff" alpha="0"/> <!--<degrafa:GradientStop ratio="0.6" color="0" alpha="0"/> <degrafa:GradientStop ratio="1" color="0" alpha="0.3"/>--> </degrafa:LinearGradientFill> </degrafa:fill> </degrafa:RoundedRectangle> <degrafa:RoundedRectangle x="0" y="0" width="{skinWidth}" height="{skinHeight}" cornerRadius="3"> <degrafa:stroke> <degrafa:LinearGradientStroke angle="90"> <degrafa:GradientStop ratio="0" color="#ffffff" alpha="0.5"/> <degrafa:GradientStop ratio="0.6" color="#ffffff" alpha="0"/> </degrafa:LinearGradientStroke> </degrafa:stroke> </degrafa:RoundedRectangle> </degrafa:geometry> </degrafa:GraphicRectangularBorderSkin>
This paste will be private.
From the Design Piracy series on my blog: