PDA

Просмотр полной версии : Проблема с with()


LostWarrior
18.07.2002, 14:23
Всем привет!

У меня с with() какие-то глюки, или так и есть?

with(_root.attachMovie("movie","movieName",i)){
_x=100;
_y=100;
bName="Название кнопки";
}

В результате появляется нужный мувик с координатами (100,100), НО bName - создается как _root.bName, а надо чтоб как _root["movieName"].bName

В чем проблема?

greyshaman
18.07.2002, 16:46
To set a variable inside a with action, the variable must have been declared outside the with action or you must enter the full path to the Timeline on which you want the variable to live. If you set a variable in a with action without declaring it, the with action will look for the value according to the scope chain. If the variable doesn't already exist, the new value will be set on the Timeline from which the with action was called.

RTFM батенька ;)

Nox Noctis
18.07.2002, 20:23
_root.attachMovie("movie","movieName",i, {_x:100, _y:100, bName:"bla-bla-bla"});

...это для МХ ;)