LoginButtonSkin.mxml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. ADOBE SYSTEMS INCORPORATED
  4. Copyright 2008 Adobe Systems Incorporated
  5. All Rights Reserved.
  6. NOTICE: Adobe permits you to use, modify, and distribute this file
  7. in accordance with the terms of the license agreement accompanying it.
  8. -->
  9. <!--- The default skin class for the Spark Button component.
  10. @see spark.components.Button
  11. @langversion 3.0
  12. @playerversion Flash 10
  13. @playerversion AIR 1.5
  14. @productversion Flex 4
  15. -->
  16. <s:SparkButtonSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
  17. xmlns:s="library://ns.adobe.com/flex/spark"
  18. xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
  19. minWidth="21" minHeight="21"
  20. alpha.disabled="0.5">
  21. <fx:Metadata>
  22. <![CDATA[
  23. /**
  24. * @copy spark.skins.spark.ApplicationSkin#hostComponent
  25. */
  26. [HostComponent("spark.components.Button")]
  27. ]]>
  28. </fx:Metadata>
  29. <fx:Script fb:purpose="styling">
  30. <![CDATA[
  31. import spark.components.Group;
  32. /* Define the skin elements that should not be colorized.
  33. For button, the graphics are colorized but the label is not. */
  34. static private const exclusions:Array = ["labelDisplay"];
  35. /**
  36. * @private
  37. */
  38. override public function get colorizeExclusions():Array {return exclusions;}
  39. /**
  40. * @private
  41. */
  42. override protected function initializationComplete():void
  43. {
  44. useChromeColor = true;
  45. super.initializationComplete();
  46. }
  47. /**
  48. * @private
  49. */
  50. override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number) : void
  51. {
  52. var cr:Number = getStyle("cornerRadius");
  53. if (cornerRadius != cr)
  54. {
  55. cornerRadius = cr;
  56. fill.radiusX = cornerRadius;
  57. }
  58. super.updateDisplayList(unscaledWidth, unscaledHeight);
  59. }
  60. private var cornerRadius:Number = 2;
  61. ]]>
  62. </fx:Script>
  63. <!-- states -->
  64. <s:states>
  65. <s:State name="up" />
  66. <s:State name="over" />
  67. <s:State name="down" />
  68. <s:State name="disabled" />
  69. </s:states>
  70. <!-- layer 2: fill -->
  71. <!--- @private -->
  72. <s:Rect id="fill" left="0" right="0" top="0" bottom="0" radiusX="2">
  73. <s:fill>
  74. <s:BitmapFill
  75. source.up="@Embed('resource/yjpt/login/login_button.png')"
  76. source.down="@Embed('resource/yjpt/login/login_button.png')"
  77. source.disabled="@Embed('resource/yjpt/login/login_button.png')"
  78. source.over="@Embed('resource/yjpt/login/login_button_hover.jpg')"/>
  79. </s:fill>
  80. </s:Rect>
  81. <!-- layer 8: text -->
  82. <!--- @copy spark.components.supportClasses.ButtonBase#labelDisplay -->
  83. <s:Label id="labelDisplay"
  84. textAlign="center" fontSize="14" fontFamily="微软雅黑"
  85. maxDisplayedLines="1" color.disabled="#FFFFFF" color.up="#FFFFFF"
  86. color.down="#FFFFFF" color.over="#76aac8" fontWeight="bold"
  87. horizontalCenter="0" verticalCenter="1" verticalAlign="middle"
  88. left="10" right="10" top="2" bottom="2">
  89. </s:Label>
  90. </s:SparkButtonSkin>