cker
28.12.2008, 12:57
Есть такой код:
var level = 1;
stop();
this.button_1.onPress = function() {
this._parent.container.attachMovie("myMovieClip","newclip"+level,level);
this._parent.container["newclip"+level].pimpa.pimpa_1._visible = true;
for(i=1; i<level; i++)
{
this._parent.container["newclip"+i].my_inp._visible = false;
this._parent.container["newclip"+i].my_ta._visible = false;
}
this._parent.container["newclip"+level].my_inp._visible = true;
this._parent.container["newclip"+level].my_ta._visible = true;
this._parent.container["newclip"+level].pimpa.onRollOver = function() {
for(i=1; i<level; i++)
{
this._parent.container["newclip"+i].my_inp._visible = false;
this._parent.container["newclip"+i].my_ta._visible = false;
}
this._parent.my_inp._visible = true;
this._parent.my_ta._visible = true;
};
this._parent.container["newclip"+level].pimpa.onPress= function() {
this._parent.startDrag();
};
this._parent.container["newclip"+level].pimpa.onRelease = function () {
stopDrag ();
};
this._parent.container["newclip"+level].pimpa.onReleaseOutside = function () {
stopDrag ();
};
this._parent.level++
}
Помогите понять, почему после создания мувиклипа цикл отрабатывает успешно, а при onrollover этот же цикл не отрабатывает? А то, что после цикла работает. :(
var level = 1;
stop();
this.button_1.onPress = function() {
this._parent.container.attachMovie("myMovieClip","newclip"+level,level);
this._parent.container["newclip"+level].pimpa.pimpa_1._visible = true;
for(i=1; i<level; i++)
{
this._parent.container["newclip"+i].my_inp._visible = false;
this._parent.container["newclip"+i].my_ta._visible = false;
}
this._parent.container["newclip"+level].my_inp._visible = true;
this._parent.container["newclip"+level].my_ta._visible = true;
this._parent.container["newclip"+level].pimpa.onRollOver = function() {
for(i=1; i<level; i++)
{
this._parent.container["newclip"+i].my_inp._visible = false;
this._parent.container["newclip"+i].my_ta._visible = false;
}
this._parent.my_inp._visible = true;
this._parent.my_ta._visible = true;
};
this._parent.container["newclip"+level].pimpa.onPress= function() {
this._parent.startDrag();
};
this._parent.container["newclip"+level].pimpa.onRelease = function () {
stopDrag ();
};
this._parent.container["newclip"+level].pimpa.onReleaseOutside = function () {
stopDrag ();
};
this._parent.level++
}
Помогите понять, почему после создания мувиклипа цикл отрабатывает успешно, а при onrollover этот же цикл не отрабатывает? А то, что после цикла работает. :(