Hi,

I think that I wrote a bad demonstration of my query.
I try again. The new code.



// define a module
var Vulnerable = {
  wound: function() {
    alert(this.health);
  }
};

 // the first argument isn't a class object, so there is no inheritance ...
// simply mix in all the arguments as methods:
var Person = Class.create(Vulnerable,{
  initialize: function() {
    this.health = 100;
  },
  test : function() {
    Vulnerable.wound();
  }
});

var a =  new Person();
a.test();

//undifined

Is that, I like to do.

Thank.



2012/11/9 Mich C <[email protected]>

> Hi.
>
> You code works.
>
> var a = new Person();
> a.wound(10); // 90
>
> Only  in row
>
> var Person = Class.create( Vulnerable, Display {
>
> need a comma
>
> var Person = Class.create( Vulnerable, Display*,* {
>
> Also try *`addMethods`*
>
> Person.addMethods(Display);
> Person.addMethods(Vulnerable);
>
>  --
> 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
> [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to