Ver Mensaje Individual
  #12 (permalink)  
Antiguo 12/03/2014, 17:09
Avatar de Albuss
Albuss
 
Fecha de Ingreso: enero-2012
Ubicación: Coruña
Mensajes: 475
Antigüedad: 12 años, 3 meses
Puntos: 30
Respuesta: ¿como acceder a un metodo de otro prototipo?

Entonces seria totalmente imposible hacer algo asi ? :


Código Javascript:
Ver original
  1. function PrototipoPruevaUno(){
  2.    
  3.     this.id = 1;
  4.    
  5.     this.mostrarID = function mostrarID(){
  6.    
  7.         console.log(this.id);  
  8.        
  9.     }
  10.    
  11.    
  12. }
  13.  
  14.  
  15. function PrototipoPruevaDos(){
  16.    
  17.     this.MostrarIDprototipoPruevaUno = function MostrarIDprototipoPruevaUno(){
  18.    
  19.         PrototipoPruevaUno. mostrarID();
  20.        
  21.     }
  22.    
  23. }
  24.  
  25. var ObjetoPruevaUno = new PrototipoPruevaUno();
  26. var ObjetoPruevaDos = new PrototipoPruevaDos();
  27.  
  28. ObjetoPruevaDos.MostrarIDprototipoPruevaUno();