Как вместо grid1 и grid2 сделать одно поле с полосой прокрутки?
cont_info._visible = false;
function right1 (grid, sel)
{
if (b[curSection][curPage + 1].length > sel)
{
grid.selectedIndex = undefined;
grid.getFocus();
grid2.selectedIndex = sel;
grid2.setFocus();
showImg(grid2.selectedItem.name);
ev = 39;
} // end if
} // End of the function
function left1(grid, sel)
{
if (curPage > 0)
{
--curPage;
grid.dataProvider = b[curSection][curPage];
grid2.dataProvider = b[curSection][curPage + 1];
grid.selectedIndex = sel;
showImg(grid.selectedItem.name);
ev = 37;
} // end if
} // End of the function
function left2(grid, sel)
{
grid.selectedIndex = undefined;
grid.getFocus();
_level0.grid1.selectedIndex = sel;
_level0.grid1.setFocus();
_level0.showImg(_level0.grid1.selectedItem.name);
_level0.ev = 37;
} // End of the function
function right2(grid, sel)
{
if (curPage < maxPage - 2)
{
++curPage;
grid1.dataProvider = b[curSection][curPage];
grid.dataProvider = b[curSection][curPage + 1];
grid.selectedIndex = sel;
showImg(grid.selectedItem.name);
ev = 2;
} // end if
} // End of the function
function up(grid)
{
if (!grid.selectedIndex)
{
return (undefined);
} // end if
--grid.selectedIndex;
showImg(grid.selectedItem.name);
} // End of the function
function down(grid)
{
if (grid.selectedIndex > 49)
{
return (undefined);
} // end if
++grid.selectedIndex;
showImg(grid.selectedItem.name);
} // End of the function
function showImg(tovName)
{
var _l5 = _level0.curSection.toLowerCase() + "\\" + _level0.c[tovName].img;
_level0.myImg.loadMovie(_l5);
var _l3 = _level0.c[tovName].type;
var _l2 = 464;
var _l1 = 83;
_level0.title = tovName;
if (_l3 == "swf" && !_level0.changed)
{
_level0.myImg._x = _level0.myImg._x - _l2;
_level0.myImg._y = _level0.myImg._y - _l1;
_level0.changed = true;
}
else if (_l3 == "jpg" && _level0.changed)
{
_level0.myImg._x = _level0.myImg._x + _l2;
_level0.myImg._y = _level0.myImg._y + _l1;
_level0.changed = false;
} // end if
} // End of the function
function changeSection(sectionName)
{
curSection = sectionName;
d[0] = grid1.dataProvider = b[sectionName][0];
if (b[sectionName].length > 1)
{
d[1] = grid2.dataProvider = b[sectionName][1];
}
else
{
d[1] = grid2.dataProvider = [];
} // end if
razdel = curSection;
_level0.curPage = 0;
_level0.maxPage = _level0.b[_level0.curSection].length;
_level0.grid1.selectedIndex = 0;
_level0.grid1.setFocus();
_level0.grid2.getFocus();
_level0.showImg(_level0.grid1.selectedItem.name);
} // End of the function
function showLetter(letter)
{
var _l2 = letter.toUpperCase();
if (w[curSection][_l2] == undefined)
{
return (undefined);
} // end if
var _l1 = w[curSection][_l2].col;
var _l3 = w[curSection][_l2].row;
grid1.dataProvider = b[curSection][_l1];
if (b[curSection][_l1 + 1] != undefined)
{
grid2.dataProvider = b[curSection][_l1 + 1];
}
else
{
grid2.dataProvider = [];
} // end if
grid1.selectedIndex = _l3;
grid2.selectedIndex = undefined;
curPage = _l1;
grid1.setFocus();
showImg(grid1.selectedItem.name);
} // End of the function
grid1.showHeaders = false;
grid1.vScrollPolicy = "on";
grid1.hScrollPolicy = "off";
grid1.setStyle("backgroundColor", 16777215);
grid1.rowHeight = grid2.rowHeight = 14.500000;
grid1.setStyle("fontFamily", "Verdana");
grid1.setStyle("fontSize", "10");
grid1.setStyle("fontWeight", "bold");
grid1.setStyle("fontColor", 25500000);
grid1.setStyle("borderStyle", "none");
grid1.selectable = grid2.selectable = true;
d = [];
var curSection = new String("Гранит");
changeSection(curSection);
var curPage = 0;
var maxPage = b[curSection].length;
var ev = false;
var myListener3 = new Object();
myListener3.keyDown = function (event)
{
if (grid1.selectedIndex == undefined)
{
return (undefined);
} // end if
var _l1 = grid1;
var _l2 = Key.getCode();
var _l3 = _l1.selectedIndex;
if (_l2 == 38 || _l2 == 40)
{
showImg(_l1.selectedItem.name);
}
else if (_l2 == 39 && ev != 39)
{
right1(_l1, _l3);
}
else if (_l2 == 37 && ev != 37)
{
left1(_l1, _l3);
} // end if
ev = false;
};
grid1.addEventListener("keyDown", myListener3);
var myListener4 = new Object();
myListener4.keyDown = function (event)
{
if (grid2.selectedIndex == undefined)
{
return (undefined);
} // end if
var _l1 = grid2;
var _l2 = Key.getCode();
var _l3 = _l1.selectedIndex;
if (_l2 == 38 || _l2 == 60)
{
showImg(_l1.selectedItem.name);
}
else if (_l2 == 37 && ev != 37)
{
left2(_l1, _l3);
}
else if (_l2 == 39 && ev != 39)
{
right2(_l1, _l3);
} // end if
ev = false;
};
grid2.addEventListener("keyDown", myListener4);
var myListener1 = new Object();
myListener1.cellPress = function (event)
{
if (d[0][event.itemIndex].name)
{
showImg(grid1.selectedItem.name);
} // end if
grid2.selectedIndex = undefined;
};
grid1.addEventListener("cellPress", myListener1);
var myListener2 = new Object();
myListener2.cellPress = function (event)
{
if (d[1][event.itemIndex].name)
{
showImg(grid2.selectedItem.name);
} // end if
grid1.selectedIndex = undefined;
};
_________________ Маленькая я еще, не опытная
|