Doug, My responses to your questions were not meant to be sarcastic. If you've have perceived them to be then I'm sorry about that. It's not my policy to make sarcastic comments.
Please see my responses below: --- Doug Melvin <[EMAIL PROTECTED]> wrote: > Obviously there is some confusion here.. or Raymond > is messing with me.. > > Okay.. > > With DynAPI 2 I could do the following: > > el = new EventListener(target); // instantiate an > event listener object > > el.onScroll=function(e){ //assign a function to the > event listener object > //whatever > } > scrollbar.addEventListsner(el); // add the event > listener object to a > dynlayer > and elsewhere > scrollbar.invokeEvent("scroll"); // invoke the > custom event added to the > event object > > Please hold off on the sarcasm here. > I am trying to make an effort to understand. > How would I do the above without the eventListener > object.. > i.e.; assign the target > define the _CUSTOM_ event type > invoke the custom event type. The equivalent to the EventListener Object would look like this: el={}; // instantiate an event listener object //assign a function to the event listener object el.onscroll=function(e){ //whatever }; scrollbar.addEventListsner(el); // add the event With this change also comes the removal of the DynEvent.getTarget() method (it was the only reason for having an EventListener object). For events that are created by the widget DynLayer itself, you can replace instances of e.getTarget() with e.getSource. > As for my other question.. the sarcasm really was > uncalled for. > > blarg = { > onBlarg : function(e){ > some code; > }, > doBlarg : function(what){ > some more code; > } > } > > Is completely unfamiliar syntax to me. > I had never seen such syntax until it popped up in > the DynAPI. > I wish to understand this syntax. It's best to use lower-case for event names. For example: blarg = { onblarg : function(e){ some code; }, doblarg : function(what){ some more code; } } doblarg would be a function of the blarg object, but if the blarg object was added to a DynObject using addEventListener, only the onblarg would be triggered when the invokeEvent("blarg") function is called. > Please bear with me.. > I was very new to JavaScript when I discovered > DynAPI v1. > Many of the techniques and concepts I use in any > JavaScript project is > heavily coloured > what I learned and observed working with the DynAPI. > > While I am now a competent JavaScript programmer, > there > are still some things I would never want to (and > have never done) without > the DynAPI.. > such as complex event hierarchies I understand. -- Raymond Irving > > ----- Original Message ----- > From: "Raymond Irving" <[EMAIL PROTECTED]> > To: "Doug Melvin" <[EMAIL PROTECTED]>; > <[EMAIL PROTECTED]> > Sent: Tuesday, March 11, 2003 8:27 PM > Subject: Re: [Dynapi-Dev] new eventListener()?!?!? > > > > > > --- Doug Melvin <[EMAIL PROTECTED]> > wrote: > > > anyone? > > > It would make the widget porting a little easier > if > > > I understood > > > building a custom event. > > > > > > I've never done it any way other than the DynAPI > 2 > > > way. > > > > Well, in a nutshell: > > > > var eventlistener = { > > onmousedown : function(e) { > > > > }, > > onmouseup : function(e) { > > > > } > > } > > > > The events are now placed within an object. > > > > > > > > > Also.. can someone point me to a javascript > > > reference which explains the > > > difference between the folowing two styles of > object > > > declaration? > > > > I don't have link just now but see my comments > below: > > > > > Style one (or standard as far as I can see) > > > > > > function DynObject() { > > > this.id = "DynObject"+DynObject._c++; > > > DynObject.all[this.id] = this; > > > }; > > > > The above is a standard javascript function > > > > > > > > Style two: > > > dynapi.functions = { > > > removeFromArray : function(array, index, id) { > > > ... code ... > > > } > > > } > > > > The above is a standard javascript object that > > contains the removeFromArray function. > removeFromArray > > is a property/function of the dynapi.functions > object. > > > > > > Hope that sums it up for you. > > > > -- > > Raymond Irving > > > > > ----- Original Message ----- > > > From: "Doug Melvin" <[EMAIL PROTECTED]> > > > To: "Raymond Irving" <[EMAIL PROTECTED]>; > > > <[EMAIL PROTECTED]> > > > Sent: Tuesday, March 11, 2003 1:59 AM > > > Subject: Re: [Dynapi-Dev] new > eventListener()?!?!? > > > > > > > > > > I'll ignore the sarcasm - for now.. > > > > :-) > > > > I see how event subclassing works.. maybe not > as > > > intuative? (Or I'm a > > > > dinasour) > > > > But how about custom even.. like onScroll for > > > example > > > > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > > This sf.net email is sponsored by:ThinkGeek > > > > Welcome to geek heaven. > > > > http://thinkgeek.com/sf > > > > > _______________________________________________ > > > > Dynapi-Dev mailing list > > > > [EMAIL PROTECTED] > > > > > > > > > > http://www.mail-archive.com/[EMAIL PROTECTED]/ > > > > > > > > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.net email is sponsored by:Crypto > Challenge > > > is now open! > > > Get cracking and register here for some mind > > > boggling fun and > > > the chance of winning an Apple iPod: > > > > > > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > > > _______________________________________________ > > > Dynapi-Dev mailing list > > > [EMAIL PROTECTED] > > > > > > http://www.mail-archive.com/[EMAIL PROTECTED]/ > > > > > > __________________________________________________ > > Do you Yahoo!? > > Yahoo! Web Hosting - establish your business > online > > http://webhosting.yahoo.com > === message truncated === __________________________________________________ Do you Yahoo!? Yahoo! Web Hosting - establish your business online http://webhosting.yahoo.com ------------------------------------------------------- This SF.net email is sponsored by:Crypto Challenge is now open! Get cracking and register here for some mind boggling fun and the chance of winning an Apple iPod: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en _______________________________________________ Dynapi-Dev mailing list [EMAIL PROTECTED] http://www.mail-archive.com/[EMAIL PROTECTED]/