I think this is private war :) BUT...
As far as I understand:
DynImage.getImage=function(src,w,h) {
//Search if the src is already being used
for (var i=0;i<DynImage.loadimages.length;i++) {
if (DynImage.loadimages[i].img.origsrc==src ||
DynImage.loadimages[i].img.src==src)
//If so, then return the object in the array that its using it
return DynImage.loadimages[i].img;
}
//Setting up the new Object
DynImage.loadimages[i] = {};
//Creating an Image whether w and h are null or not
if (w&&h) DynImage.loadimages[i].img = new Image(w,h);
else DynImage.loadimages[i].img = new Image();
//src of the image
DynImage.loadimages[i].img.src=DynImage.loadimages[i].img.origsrc=src;
//Adds a new property to the object so you're not getting a "native"
Image object
DynImage.loadimages[i].img.dynimages=[];
//Method class Martin wrote about
if (DynAPI.loaded && !DynImage.timerId) DynImage.loaderStart();
//return :)
return DynImage.loadimages[i].img;
};
DynImage.prototype.getImage() is used when you're creating a
DynImage-object like:
di = new DynImage("image.gif");
alert(di.getImage());
the static method, DynImage.getImage(src, w, h) can be used alone
or together with a DynImage-object, like in this case, a preloader.
Well the way I see it, di.getImage() does exactly the same as
DynImage.getImage(), they are 2 diferent functions (one of them is a
method and the other one is a function) and they don�t over write them
selves!!
Both created to get the image, BUT:
DynImage.prototype.getImage = function (imgObject) {
return this.img;
};
Is used to perform an action over an object (di.getIm...) [yes a method]
And
DynImage.getImage = function ()
Is a function called DynImage.getImage not a method of a DynImage object
Well that's what I think ;)
_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dynapi-help