From: Cameron H. <ca...@bi...> - 2000-11-30 18:37:17
|
I'm doing some experiments with the LoadPanel using the DynAPI-2000-11-09 distribution. What I would like the be able to do is set up a handler in my document that is executed when the LoadPanel completes loading a URL. Currently I have a handler that copes with oncreate events. That's fairly straight forward, however if I set up a handler to catch onload events the same way it doesn't seem to catch anything. I am presuming that the LoadPanel gives off an onload event as there is an invokeEvent("load") call in the library code. Is that a correct assumption? Here's some code that sets up the panel and catches the oncreate: this.canvas = new LoadPanel(url) this.canvas.setSize(this.getWidth() - this.buttonWidth,this.getHeight()) this.canvas.moveTo(0,0) this.canvas.setBgColor('#ffffff') //this.canvas.autoW = false this.addChild(this.canvas) var l = new EventListener(this) // on create, check if need the scroll button l.oncreate=function(e) { alert("LoadPanel created") } this.addEventListener(l) Anyone know where an onload handler fit into the scheme of things here? I've tried just making another event by doing l.onload = function(e) etc Any hints appreciated, I haven't really got my head around events yet! Thanks, Cameron. |