I have made this objec because I'm trying to encapsulate the namespaces
so that it'll work for multiple images on one page and I'd like to be
able give this away to people. However when I run this the
this.fadeimages property get's lost I don't know why. here's the code
<html><head><title>EXample</title><script type="text/javascript">
function Fader() {
this.fadeimages=new Array()
}
Fader.prototype.getfadeimages=getfadeimages;
function getfadeimages() {
alert('getfadeimgaes');
return this.fadeimages;
}//end getfadeimges()
Fader.prototype.setfadeimages=setfadeimages;
function setfadeimages(arry) {
alert('setfadeimages');
this.fadeimages=arry;
}//end setfadeimgaes
Fader.prototype.go=go;
function go() {
alert('GO');alert(self.getfadeimages()[0][0]);
}
</script></head><body><script type="text/javascript">
var fader=new Fader();
imagelist=new Array();
imagelist[0]=["stock/table1.jpg", "", ""] //plain image syntax
imagelist[1]=["stock/cake1.jpg", "http://www.google.com", ""] //image
with link syntax
imagelist[2]=["stock/eggs1.jpg", "http://www.javascriptkit.com",
"_new"] //image with link and target syntax
fader.setfadeimages(imagelist);
alert('fadeimages[2][2] ' + fader.fadeimages[2][2]);
fader.go()
</script></body></html>