Rewers
18.11.2007, 22:34
Не могу веделить массив для переменой в функции так чтобы чтобы одна и таже функция выполнялась в выделеном для ней массивом вот или тут прикол не в массиве
function vl(name) {
var mos = new Array(_root.mc1, _root.mc2, _root.mc3, _root.mc4, _root.mc5);
for (i=1; i<6; i++) {
mos[i] = eval("mc"+i);
if (_root["mc"+i] != name) {
_root["mc"+i].onEnterFrame = function() {
if (this._alpha>0) {
this._alpha -= 20;
} else if (this._alpha<=0) {
this._visible = false;
}
};
}
name.onEnterFrame = function() {
name._xscale = 300;
name._yscale = 300;
};
}
}
function vli(name) {
var mos = new Array(_root.mc1, _root.mc2, _root.mc3, _root.mc4, _root.mc5);
for (i=1; i<6; i++) {
mos[i] = eval("mc"+i);
if (_root["mc"+i] != name) {
_root["mc"+i].onEnterFrame = function() {
this._visible = true;
if (this._alpha<100) {
this._alpha += 10;
}
};
}
name.onEnterFrame = function() {
name._xscale = 100;
name._yscale = 100;
};
}
}
function btn() {
for (i=1; i<6; i++) {
_root["mc"+i].onRollOver = function() {
vl(this);
};
_root["mc"+i].onRollOut = function() {
vli(this);
};
}
}
btn();
вот примерчик
function vl(name) {
var mos = new Array(_root.mc1, _root.mc2, _root.mc3, _root.mc4, _root.mc5);
for (i=1; i<6; i++) {
mos[i] = eval("mc"+i);
if (_root["mc"+i] != name) {
_root["mc"+i].onEnterFrame = function() {
if (this._alpha>0) {
this._alpha -= 20;
} else if (this._alpha<=0) {
this._visible = false;
}
};
}
name.onEnterFrame = function() {
name._xscale = 300;
name._yscale = 300;
};
}
}
function vli(name) {
var mos = new Array(_root.mc1, _root.mc2, _root.mc3, _root.mc4, _root.mc5);
for (i=1; i<6; i++) {
mos[i] = eval("mc"+i);
if (_root["mc"+i] != name) {
_root["mc"+i].onEnterFrame = function() {
this._visible = true;
if (this._alpha<100) {
this._alpha += 10;
}
};
}
name.onEnterFrame = function() {
name._xscale = 100;
name._yscale = 100;
};
}
}
function btn() {
for (i=1; i<6; i++) {
_root["mc"+i].onRollOver = function() {
vl(this);
};
_root["mc"+i].onRollOut = function() {
vli(this);
};
}
}
btn();
вот примерчик