I think I set you on the right path... copy the code a gave you and see what
you can come up with.

Rick



On Mon, Jun 29, 2009 at 12:56 PM, Sven <stuebe...@googlemail.com> wrote:

>
> hmm but wait....
>
> this is a global event...
> i want a instance-based event.
>
> xyz.foo(); //alert("barbarbar");
> abc.foo(); // alert("1234"); and second $('bla').hide();
>
> rgds sven
>
> On 29 Jun., 18:41, Sven <stuebe...@googlemail.com> wrote:
> > wow thank you ;)
> >
> > On 29 Jun., 18:38, Rick Waldron <waldron.r...@gmail.com> wrote:
> >
> >
> >
> > > Dig it:
> >
> > >http://jsbin.com/uhogi
> >
> > > (view the source)
> >
> > > Rick
> >
> > > On Mon, Jun 29, 2009 at 12:19 PM, Sven <stuebe...@googlemail.com>
> wrote:
> >
> > > > Hi,
> >
> > > > is it possible to add Events to own classes?
> >
> > > > something like this:
> >
> > > > var myClass = Class.create({
> > > >        foo : function(){
> > > >                this.fire('bar');
> > > >        }
> > > > });
> >
> > > > var xyz = new MyClass();
> > > > xyz.observe('bar', function(){alert("barbarbar");});
> >
> > > > rgds sven
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to