Форум Flasher.ru

Форум Flasher.ru (http://www.flasher.ru/forum/index.php)
-   ActionScript 1.0/2.0 (http://www.flasher.ru/forum/forumdisplay.php?f=93)
-   -   как дотянуться с _root до текста, чтобы изменить его? (http://www.flasher.ru/forum/showthread.php?t=120123)

polol 12.01.2009 21:30

как дотянуться с _root до текста, чтобы изменить его?
 
в _root лежит мувик "mclip", в котором я создал функцией типа

Код AS1/AS2:

addName ("mov01", 9, high ,  middle , inside01, XMLdaten_exchange[0])

несколько текстовых полей (
Код AS1/AS2:

this[clipName].textFieldName.text = textContent

).

вот таким образом:

Код AS1/AS2:

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;
clip._alpha = 0
 
 
 
this[clipName].createTextField("textFieldName", this[clipName].getNextHighestDepth(), 0, 0, 200, 100);
 
....
 
this[clipName].textFieldName.embedFonts = true;
this[clipName].textFieldName.setNewTextFormat(myfromat);
 
this[clipName].textFieldName.text = textContent
 
 
}



как дотянуться с _root до текста mov01.inside01.text, чтобы изменить его?


не могу найти путь.

AlexCooper 12.01.2009 21:43

Текстовые поля не имеют зависимости от _alpha
На сколько я понимаю последовательность такая:
Код AS1/AS2:

_root
_root.mclip
_root.mclip.addName=function()
_root.mclip[clipName].textFieldName.text=textContent;

Добавлено через 7 минут
Стоп. Это что?
Код AS1/AS2:

var clip:MovieClip = this.createEmptyMovieClip (clipName , depth)

жаль нет времени проверять, компилирую в голове.
но поидеи
Код AS1/AS2:

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]._alpha = 0

.............................
}[/as]

polol 12.01.2009 22:06

2AlexCooper

Цитата:

Стоп. Это что?
http://www.flasher.ru/forum/showthread.php?t=119950

вот не понял я самого принципа, теперь маюсь. просто все заработало, на тот момент этого хватало

Добавлено через 41 минуту
Цитата:

жаль нет времени проверять, компилирую в голове.
но поидеи...
Код AS1/AS2:

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]._alpha = 0

с этим к сожалению ничего не вышло

AlexCooper 13.01.2009 03:16

Код AS1/AS2:

----------------- В mclip ----------------------
function addName(clipName:String, depth:Number, yPlace:Number, xPlace:Number, textFieldName:String, textContent:String) {
 
 
        var clip:MovieClip = this.createEmptyMovieClip([clipName],depth);
        clip._y = yPlace;
        clip._x = xPlace;
        //clip._alpha = 0;
 
        clip.createTextField(textFieldName,clip.getNextHighestDepth(),0,0,200,100);
        //clip['textFieldName'].embedFonts = true;
        //clip['textFieldName'].setNewTextFormat(myfromat);
        clip[textFieldName].text = textContent;
 
}
-------------- Любо где ----------
_root.mclip.addName('Contejner',1,100,100,'TextBox1','A-бугага');
 
 
 
-------------- Доступ ------------
_root.mclip.Contejner.TextBox1.text='Bukake';



Часовой пояс GMT +4, время: 12:19.

Copyright © 1999-2008 Flasher.ru. All rights reserved.
Работает на vBulletin®. Copyright ©2000 - 2026, Jelsoft Enterprises Ltd. Перевод: zCarot
Администрация сайта не несёт ответственности за любую предоставленную посетителями информацию. Подробнее см. Правила.