W
windandwaves
Hi Folk
I have the following function
var a = new Array(4);
a[0] = new Array(45); //status (on or off)
a[1] = new Array(45); //name of the region
a[2] = new Array(45); //on mouse over
a[3] = new Array(45); //on mouse out
a[0][0] = false;
.....snip
a[1][0] = "region name";
......snip
a[2][1] = new Array('x', 'b','c','d',); // outer islands
a[2][2] = new Array('h', 'x', 'x', 'n');
....snip
a[3][1] = new Array('a', 'b','c','d',); // outer islands
a[3][2] = new Array('h', 'h', 'n', 'n');
....snip
function Rx(i) {
var j;
var dd = new Array();
document.getElementById('r'+i).checked ? j = 3 : j = 2;
dd = a[j];
si(dd);
}
function si() {
if (document.images && (preloadFlag == true)) {
var img;
for (var i=0; i<si.arguments.length; i+=2) {
img = null;
if (document.layers) {
img = findElement(si.arguments,0);
}
else {
img = document.images[si.arguments];
}
if (img) {
img.src = si.arguments[i+1]+'.gif';
}
}
}
}
My problem is when I call the Rx(i) function, it passes the whole array (e.g. a[2][3]) as one variable to si and not an array,
therefore, si does not work. What am I doing wrong?
There are about 200 a[j] variables, some of which are arrays in themselves.
TIA
- Nicolaas
I have the following function
var a = new Array(4);
a[0] = new Array(45); //status (on or off)
a[1] = new Array(45); //name of the region
a[2] = new Array(45); //on mouse over
a[3] = new Array(45); //on mouse out
a[0][0] = false;
.....snip
a[1][0] = "region name";
......snip
a[2][1] = new Array('x', 'b','c','d',); // outer islands
a[2][2] = new Array('h', 'x', 'x', 'n');
....snip
a[3][1] = new Array('a', 'b','c','d',); // outer islands
a[3][2] = new Array('h', 'h', 'n', 'n');
....snip
function Rx(i) {
var j;
var dd = new Array();
document.getElementById('r'+i).checked ? j = 3 : j = 2;
dd = a[j];
si(dd);
}
function si() {
if (document.images && (preloadFlag == true)) {
var img;
for (var i=0; i<si.arguments.length; i+=2) {
img = null;
if (document.layers) {
img = findElement(si.arguments,0);
}
else {
img = document.images[si.arguments];
}
if (img) {
img.src = si.arguments[i+1]+'.gif';
}
}
}
}
My problem is when I call the Rx(i) function, it passes the whole array (e.g. a[2][3]) as one variable to si and not an array,
therefore, si does not work. What am I doing wrong?
There are about 200 a[j] variables, some of which are arrays in themselves.
TIA
- Nicolaas