2012-09-05 47 views

回答

3

使用type屬性,其將返回一個字符串TextFieldType枚舉值:

//Assuming a DisplayObjectContainer called 'doc': 
for (var i:int = 0; i < doc.numChildren; i++) 
{ 
    var tf:TextField = doc.getChildAt(i) as TextField; 
    if (tf != null) // Will be null if the child isn't a TextField 
    { 
     switch(tf.type) 
     { 
      case TextFieldType.DYNAMIC: 
       trace("Dynamic"); 
       break; 
      case TextFieldType.INPUT: 
       trace("Input"); 
       break; 
     } 
    } 
} 

的文檔是好的,明確的:對我

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.html#type

+0

THX,羞恥,我錯過了文檔類型的財產:( –

+0

呃。沒有羞恥。我們都做到了。樂意效勞。 – JcFx

相關問題