From: Brian H. <bg...@ke...> - 2003-09-10 19:05:12
|
Hello, I am relatively new to the dynapi project, but as open source projects go, this one has captured the attention of several. With that said and (Excellent job guys/girls) I do have a question and statement. I have been studying and writing code using the dynapi 3x for about three week solid, and although my JS skills are lacking, I have managed to get up to speed in programming using this api. See: www.keyout.com/keyout/test.cfm. as you can see from this, my goal is a simple one, but complicate one as well. The question: How do you do to images as you do to layers? Example: This.Lyr = new DynLayer(null,0,0,100,100,"e0e0e0"); From this you can: this.Lyr.setSize(250,250); Or animate the growth via some math and calling the same funtion until you reach your desired W and H. But for images? I have tried to simulate this, and have done so, but extending outside the dynapi library. So, if possible could some one show me how or guild me on this on how it can be done with images? This is from some of the example, but the image does not change on load. Unless I use the document.images[0] object. dynapi.library.include('dynapi.api'); dynapi.library.include('dynapi.functions.Image'); dynapi.library.include('dynapi.functions.system'); var zoomi = dynapi.functions.getImage("/Keyout/Keyout/Zoom-Object.gif",null,null,{al ias:"test"}); var Layer = new DynLayer(zoomi.getHTML(),0,0,800,800,null); Layer.setVisible(false); dynapi.document.addChild(Layer); dynapi.functions.captureImageProgress(fn) dynapi.functions.setImageTTL(15000) function fn(completed,failed,total){ if(completed < total){ Layer.setVisible(false);} // Not done loading. if((completed+failed)==total) { // We got failures. var a=dynapi.functions.getFailedImages(); for(var i=0;i<a.length;i++){ a[i].reload(); } } if (completed == total) { //We gotem all so do something usefull. Layer.setVisible(true); //hide layer untill images are loaded.. var test = dynapi.ximages['test']; test.height = 100; }; // we got them all. } |
From: Raymond I. <xw...@ya...> - 2003-09-10 23:17:02
|
Hi Brian, Because you can have multiple copies of the same images loaded at the same time we did not allow you to bind the inserted image with the one create using getImage(). But here's a workaround var Layer = new DynLayer(zoomi.getHTML({name:'zoomi'}),0,0,800,800,null); .... .... // when loaded you should be able // to get the image object call zoomi var img = document.images['zoomi']; img.height = 100; -- Raymond Irving --- Brian Hayes <bg...@ke...> wrote: > Hello, I am relatively new to the dynapi project, > but as open source > projects go, this one has captured the attention of > several. With that > said and (Excellent job guys/girls) I do have a > question and statement. > > I have been studying and writing code using the > dynapi 3x for about > three week solid, and although my JS skills are > lacking, I have managed > to get up to speed in programming using this api. > See: > www.keyout.com/keyout/test.cfm. as you can see from > this, my goal is a > simple one, but complicate one as well. > > The question: How do you do to images as you do to > layers? > > Example: > > This.Lyr = new > DynLayer(null,0,0,100,100,"e0e0e0"); > > From this you can: this.Lyr.setSize(250,250); > Or animate the growth via some math and calling the > same funtion until > you reach your desired W and H. > > But for images? I have tried to simulate this, and > have done so, but > extending outside the dynapi library. So, if > possible could some one > show me how or guild me on this on how it can be > done with images? > > This is from some of the example, but the image does > not change on load. > Unless I use the document.images[0] object. > > dynapi.library.include('dynapi.api'); > > dynapi.library.include('dynapi.functions.Image'); > > dynapi.library.include('dynapi.functions.system'); > > var zoomi = > dynapi.functions.getImage("/Keyout/Keyout/Zoom-Object.gif",null,null,{al > ias:"test"}); > var Layer = new > DynLayer(zoomi.getHTML(),0,0,800,800,null); > Layer.setVisible(false); > dynapi.document.addChild(Layer); > > > > dynapi.functions.captureImageProgress(fn) > dynapi.functions.setImageTTL(15000) > > function fn(completed,failed,total){ > if(completed < total){ > Layer.setVisible(false);} > // Not done loading. > > if((completed+failed)==total) { // > We got failures. > var > a=dynapi.functions.getFailedImages(); > for(var > i=0;i<a.length;i++){ > > a[i].reload(); > } > } > if (completed == total) { > //We gotem all so do > something usefull. > > Layer.setVisible(true); //hide layer > untill images are loaded.. > var test = > dynapi.ximages['test']; > test.height = > 100; > }; // we got them all. > } > > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com |
From: Brian H. <bg...@ke...> - 2003-09-11 11:57:20
|
That worked!! thanks you for the help, and here is the code used.. <SCRIPT LANGUAGE="JavaScript"> <!-- var zoomi = dynapi.functions.getImage("Zoom-Object.gif",null,null); var Layer = new DynLayer(zoomi.getHTML({name:'test'}),0,0,400,400,null); Layer.setVisible(false); dynapi.functions.captureImageProgress(fn) dynapi.functions.setImageTTL(15000) function fn(completed,failed,total){ if(completed < total){ Layer.setVisible(false);} // Not done loading. if((completed+failed)==total) { // We got failures. var a=dynapi.functions.getFailedImages(); for(var i=0;i<a.length;i++){ a[i].reload(); } } if (completed == total) { Layer.setVisible(true); var test = document.images['test']; // With this we can do what we need with the image element. //test.height = 100; // This will only work in IE, but can be done via a <a onclick> tag.. }; // we got them all. } dynapi.document.addChild(Layer); //--> </SCRIPT> -----Original Message----- From: dyn...@li... [mailto:dyn...@li...] On Behalf Of Raymond Irving Sent: Wednesday, September 10, 2003 7:17 PM To: dyn...@li... Subject: Re: [Dynapi-Help] Doing to images what can be done do DynLayer Hi Brian, Because you can have multiple copies of the same images loaded at the same time we did not allow you to bind the inserted image with the one create using getImage(). But here's a workaround var Layer = new DynLayer(zoomi.getHTML({name:'zoomi'}),0,0,800,800,null); .... .... // when loaded you should be able // to get the image object call zoomi var img = document.images['zoomi']; img.height = 100; -- Raymond Irving --- Brian Hayes <bg...@ke...> wrote: > Hello, I am relatively new to the dynapi project, > but as open source > projects go, this one has captured the attention of > several. With that > said and (Excellent job guys/girls) I do have a > question and statement. > > I have been studying and writing code using the > dynapi 3x for about > three week solid, and although my JS skills are > lacking, I have managed > to get up to speed in programming using this api. > See: > www.keyout.com/keyout/test.cfm. as you can see from > this, my goal is a > simple one, but complicate one as well. > > The question: How do you do to images as you do to > layers? > > Example: > > This.Lyr = new > DynLayer(null,0,0,100,100,"e0e0e0"); > > From this you can: this.Lyr.setSize(250,250); > Or animate the growth via some math and calling the > same funtion until > you reach your desired W and H. > > But for images? I have tried to simulate this, and > have done so, but > extending outside the dynapi library. So, if > possible could some one > show me how or guild me on this on how it can be > done with images? > > This is from some of the example, but the image does > not change on load. > Unless I use the document.images[0] object. > > dynapi.library.include('dynapi.api'); > > dynapi.library.include('dynapi.functions.Image'); > > dynapi.library.include('dynapi.functions.system'); > > var zoomi = > dynapi.functions.getImage("/Keyout/Keyout/Zoom-Object.gif",null,null,{al > ias:"test"}); > var Layer = new > DynLayer(zoomi.getHTML(),0,0,800,800,null); > Layer.setVisible(false); > dynapi.document.addChild(Layer); > > > > dynapi.functions.captureImageProgress(fn) > dynapi.functions.setImageTTL(15000) > > function fn(completed,failed,total){ > if(completed < total){ > Layer.setVisible(false);} > // Not done loading. > > if((completed+failed)==total) { // > We got failures. > var > a=dynapi.functions.getFailedImages(); > for(var > i=0;i<a.length;i++){ > > a[i].reload(); > } > } > if (completed == total) { > //We gotem all so do > something usefull. > > Layer.setVisible(true); //hide layer > untill images are loaded.. > var test = > dynapi.ximages['test']; > test.height = > 100; > }; // we got them all. > } > > __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dynapi-Help mailing list Dyn...@li... https://lists.sourceforge.net/lists/listinfo/dynapi-help |