Patches #407367, was updated on 2001-03-09 11:04 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=305757&aid=407367&group_id=5757 Category: DynAPI-Widget Group: None Status: Open Priority: 5 Submitted By: David Zoll Assigned to: Nobody/Anonymous Summary: Fix Button.setImage Behavior Initial Comment: This appears to fix the Button.setImage() behavior under IE described in Bug #407366. ---------------------------------------------------------------------- Comment By: David Zoll Date: 2001-03-12 06:29 Message: Logged In: YES user_id=25730 > Possibly you meant to say: > > this.imglyr.setImage(imgObj) Yes I did, sorry, I copied the fix incorrectly when making the diff file, here's the correct diff file: --- button.js.orig Fri Mar 9 13:45:46 2001 +++ button.js Mon Mar 12 09:10:22 2001 @@ -80,7 +80,7 @@ this.imglyr = this.addChild(new DynImage(imgObj)); this.imglyr.setVisible(false); } - else this.imglyr.doc.images[0].src = this.img.src; + else this.imglyr.setImage(imgObj); }; Button.prototype.setText = function(text) { if (this.label==null) { > What exact problem are you having? Under IE , "this.imglyr.doc.images[0].src = this.img.src;" will always set the first image, rather than the image in this.imglyr. > But if you read the code for setImage, it does pretty much > what the line thats there now does. No, DynImage.prototype.setImage() uses the syntax "this.doc.images[this.id+'Image'].src = this.img.src", which actually works under both IE and Netscape. Furthermore, by calling the DynImage function instead of copying the syntax, there is only one place to maintain this code (eg. if it needs to become more complicated to handle additional browsers). ---------------------------------------------------------------------- Comment By: Robert Rainwater Date: 2001-03-10 22:58 Message: Logged In: YES user_id=16618 I do not understand this line at all: else this.imglyr.setImage(imgObj) = this.img.src; You are calling a function to set the image after returning a value to the function call. I've never seen anything like that and can't imagine what it does. This line: else this.imglyr.doc.images[0].src = this.img.src; Sets the image of the layer. If you are using a dynimage then the layer only contains one image, thus .doc.images[0] should be correct. Please explain more. Possibly you meant to say: this.imglyr.setImage(imgObj) But if you read the code for setImage, it does pretty much what the line thats there now does. What exact problem are you having? ---------------------------------------------------------------------- Comment By: David Zoll Date: 2001-03-09 11:05 Message: Logged In: YES user_id=25730 The patch didn't appear to upload, so here it is: --- button.js.orig Fri Mar 9 13:45:46 2001 +++ button.js Fri Mar 9 13:46:12 2001 @@ -80,7 +80,7 @@ this.imglyr = this.addChild(new DynImage(imgObj)); this.imglyr.setVisible(false); } - else this.imglyr.doc.images[0].src = this.img.src; + else this.imglyr.setImage(imgObj) = this.img.src; }; Button.prototype.setText = function(text) { if (this.label==null) { ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=305757&aid=407367&group_id=5757 _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://lists.sourceforge.net/lists/listinfo/dynapi-dev
