作者HelloJimmy (揪~~竟,能不能考上?)
看板Flash
標題[問題] 使用SkinClass後無法輸入中文
時間Fri May 17 01:54:32 2013
大家好,
我的TextArea物件在使用SkinClass做美化後,
無法輸入中文.
以下是程式碼:
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin
xmlns:fx="
http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark>
<fx:Metadata>
[HostComponent("views.punchView")]
</fx:Metadata>
<fx:Declarations>
<!--設定提示文字開關-->
<fx:Boolean id="focused">false</fx:Boolean>
</fx:Declarations>
<fx:Script>
<![CDATA[
static private const exclusions:Array = ["labelElement"];
//覆寫SparkSkin內colorizeExclusions()
override public function get colorizeExclusions():Array
{
return exclusions;
}
]]>
</fx:Script>
<!--按鍵狀態-->
<s:states>
<!--一般-->
<s:State name="normal" />
<!--不可點-->
<s:State name="disabled" />
</s:states>
<s:Scroller
id="scroller"
left="0"
top="0"
right="0"
bottom="0"
minViewportInset="1"
measuredSizeIncludesScrollBars="false"
hasFocusableChildren="false">
<!--正常文字-->
<s:RichEditableText
id="textDisplay"
backgroundColor="#FFFFFF"
backgroundAlpha="0"
paddingLeft="15"
color="#FFFFFF"
focusIn="focused = true;"
focusOut="focused = false;"
/>
</s:Scroller>
<!--提示文字-->
<s:RichText
id="hintTxt"
mouseEnabled="false"
mouseChildren="false"
paddingLeft="15"
visible="{!(textDisplay.text != '' || focused)}"
text="{getStyle('hint')}"
color="#FFFFFF"
backgroundColor="#FFFFFF"
backgroundAlpha="0"/>
</s:SparkSkin>
請高手解惑,
謝謝~
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.166.211.12
→ bera:[HostComponent("views.punchView")] 不用是TextArea嗎 05/20 16:48
→ bera:你要不要順便貼你元件的程式碼, 這個Skin TextArea無法套用啊 05/20 16:50
→ HelloJimmy:punchView就是使用skinclass的view元件,裡頭有個 05/22 00:41
→ HelloJimmy:TextArea套用了這個skinclass.punchview有點肥... 05/22 00:42