2013-03-16 41 views
0

的CSS樣式值我有一個風格:獲得從自定義組件

.rating{ 
     fontSize:24; 
} 

和一個自定義MXML組件S型|圖形。如何從ActionScript中的組件獲取fontSize值?

我想:

public var fff:String = getStyle("fontSize"); //undefined (runtime error) 
public var fff2:String = this.getStyle("fontSize"); // undefined (compile time error) 
+1

你是什麼意思掉?我很確定它的fontSize是flex,甚至沒有代碼暗示字體大小。 – DominicM 2013-03-16 13:49:27

+0

看看這個http://livedocs.adobe.com/flex/3/html/help.html?content=styles_08.html – btevfik 2013-03-17 00:53:09

+0

這很有幫助,通過在初始化函數中添加這一行來解決它:somevar = this。的getStyle( 「fontSize的」);請添加它作爲答案,謝謝。 – DominicM 2013-03-17 13:05:19

回答