![]() |
|
||||||||||
|
|
|
|||||
|
Регистрация: Aug 2009
Сообщений: 53
|
всем привет !
пре попытке удалить ссылку на объект прыгает ошибка : 1050: Cannot assign to a non-reference value. var tf:TextField; var container :Sprite = new Sprite(); addChildAt (container,0); button.addEventListener (MouseEvent.CLICK,addTextField); function addTextField (evt:MouseEvent) { while (container.numChildren>0) { //Error container.getChildAt(0) as TextField = null; } for (var i:Number=0; i<4; i++) { tf = new TextField(); tf.y = i *23; tf.text = "temp text"; container.addChild(tf); } } насколько это верно ? |
|
|||||
|
...
модератор форума
Регистрация: Sep 2006
Адрес: Minsk
Сообщений: 4,286
|
Цитата:
И если на объект нету больше ссылок. |
|
|||||
|
Регистрация: Aug 2009
Сообщений: 53
|
а если мои объект (динамически инстанс) наследует класс в котором объявляются Fonts, setTextFormat , TextFilds :
package com { import flash.text.Font; import flash.text.TextField; import flash.text.TextFormat; public class regionMyltyTetxFild extends TextField { public function regionMyltyTetxFild (lang:Number,s:String,w:Number,align:Boolean) { var textFormat:TextFormat = new TextFormat(); var newHebFont:Font = new hebFont(); this.selectable = false; this.embedFonts = true; this.mouseEnabled = false; textFormat.color = 0x59311c; this.width = w; //heb if (lang == 1) { textFormat.font = newHebFont.fontName; if (align == true) { textFormat.size = 25; } else { textFormat.size = 17; } this.text = hebInvert(s); } textFormat.align = "center"; this.setTextFormat (textFormat); } public function hebInvert (s:String):String { var tempWord:String = ""; for (var i :Number =0; i<s.length; i++) { tempWord += s.charAt(s.length - i - 1); } return tempWord; } } } Последний раз редактировалось adi.belis; 26.08.2009 в 06:09. |
|
|||||
|
...
модератор форума
Регистрация: Sep 2006
Адрес: Minsk
Сообщений: 4,286
|
Если выполнены все предыдущие условия, то да. И названия классов пишуться с большой буквы.
|
![]() |
![]() |
Часовой пояс GMT +4, время: 23:16. |
|
|
« Предыдущая тема | Следующая тема » |
|
|