![]() |
|
||||||||||
|
|||||||
|
|
« Предыдущая тема | Следующая тема » |
| Опции темы | Опции просмотра |
|
![]() |
![]() |
|
|||||
|
Регистрация: Aug 2006
Сообщений: 102
|
не могу нащупать созданный мувик. и координаты tracить не получается. для функции какая-то своя специфика?
function addName (clipName:String, depth:Number, yPlace, xPlace, textFieldName:String, textContent:String) { this.createEmptyMovieClip ("clipName" , depth) this.clipName._y = yPlace; this.clipName._x = xPlace; this.clipName.createTextField("textFieldName", this.clipName.getNextHighestDepth(), 0, 0, 200, 100); var mytext_format = new TextFormat(); mytext_format.font = 'Arial'; mytext_format.size = 18; mytext_format.color = 0x000000; this.clipName.textFieldName.embedFonts = true; this.clipName.textFieldName.setNewTextFormat(mytext_format); this.clipName.textFieldName.text = textContent } addName (numberBox01, 9, 10 , 100 , textInside1, "01") addName (numberBox02, 8, 10 , 200 , textInside2, "02") addName (numberBox03, 7, 10 , 300 , textInside3, "03") addName (numberBox04, 6, 100 , 100 , textInside4, "04") addName (numberBox05, 5, 100 , 200 , textInside5, "05") addName (numberBox06, 4, 100, 300 , textInside6, "06") addName (numberBox07, 3, 200 , 100 , textInside7, "07") addName (numberBox08, 2, 200 , 200 , textInside8, "08") addName (numberBox09, 1, 200 , 300 , textInside9, "09") trace(this.numberBox01._x) спасибо |
|
|||||
|
в своей функции первый параметр вы объявили как строка:
, а передаёте туда что-то, но точно не строку это имело бы смысл: function addName (clipName:String, depth:Number, yPlace, xPlace, textFieldName:String, textContent:String) { var clip:MovieClip = this.createEmptyMovieClip (clipName, depth); clip._y = yPlace; .... , а не |
|
|||||
|
ветеран форума
|
Цитата:
вы передаете не строчку, а объект numberBox01, которого не существует. Имя будет у клипа "undefined" поэтому. Вот так правильно: (это минус AS1/2 кстати: не распознается использование ссылок на несуществующие объекты. В AS3 компилятор за это сразу ругает)
__________________
4am is time to rock |
|
|||||
|
Регистрация: Aug 2006
Сообщений: 102
|
не знаю, правильно ли я скорректировал, но значения trace не соответствуют истине...
function addName (clipName:String, depth:Number, yPlace, xPlace, textFieldName:String, textContent:String) { var clip:MovieClip = this.createEmptyMovieClip (clipName , depth) clip._y = yPlace; clip._x = xPlace; this[clipName].createTextField("textFieldName", this[clipName].getNextHighestDepth(), 0, 0, 200, 100); var mytext_format = new TextFormat(); mytext_format.font = 'Arial'; mytext_format.size = 18; mytext_format.color = 0x000000; this[clipName].textFieldName.embedFonts = true; this[clipName].textFieldName.setNewTextFormat(mytext_format); this[clipName].textFieldName.text = textContent } addName (numberBox01, 9, 10 , 100 , textInside1, "01") addName (numberBox02, 8, 10 , 200 , textInside2, "02") addName (numberBox03, 7, 10 , 300 , textInside3, "03") addName (numberBox04, 6, 100 , 100 , textInside4, "04") addName (numberBox05, 5, 100 , 200 , textInside5, "05") addName (numberBox06, 4, 100, 300 , textInside6, "06") addName (numberBox07, 3, 200 , 100 , textInside7, "07") addName (numberBox08, 2, 200 , 200 , textInside8, "08") addName (numberBox09, 1, 200 , 300 , textInside9, "09") trace(this[numberBox01]._y) вверху это был ответ для fljot >darkLight сейчас попробую |
|
|||||
|
Регистрация: Nov 2007
Сообщений: 1,724
|
polol, зачем второй раз вставлять код?
|
|
|||||
|
Регистрация: Aug 2006
Сообщений: 102
|
"numberBox01" в комбинации с советом fljot работает!
премного благодарен |
![]() |
![]() |
Часовой пояс GMT +4, время: 06:20. |
|
|
« Предыдущая тема | Следующая тема » |
|
|