我創建了一個按鈕名稱:編輯文本 - AS3
menuButton
和按鈕裏面我有兩個文本框與下面的名稱;
name_mb
level_mb
我已創建約6個此對象/按鈕的實例。我試圖爲這些按鈕的每個實例更改這些文本框的文本(每個實例具有不同的名稱)。
這就是我想要做到的;
menu_One.level_mb.text = "hello";
menu_One; The name of instance
不過,我得到以下錯誤:
Symbol 'menuButton', Layer 'Layer 1', Frame 1 Warning: The instance name 'level_mb' is declared on an object of type fl.text.TLFTextField but there is a conflicting use of the instance name 'level_mb' on an object of type flash.display.InteractiveObject.
Symbol 'menuButton', Layer 'Layer 1', Frame 1 Warning: The instance name 'name_mb' is declared on an object of type fl.text.TLFTextField but there is a conflicting use of the instance name 'name_mb' on an object of type flash.display.InteractiveObject
。 這是由於同一對象/按鈕的多個實例嗎?
或者我可以爲我需要的每個按鈕創建一個新按鈕,並手動給它文本。我寧願通過代碼來完成,因爲我將有大約10個按鈕,並且在將來如果我需要添加更多的按鈕,它將變得更加容易。
如果需要,我可以提供更多的代碼。