Hola lista:
tengo una clase que manda unos eventos y otra que se subscribe a ellos, pero
no hay forma de pillar estos eventos. A ver si me decis que estoy haciendo
mal...

la que manda los eventos:

=========================================================
import mx.events.EventDispatcher;
class InteraccionUser{
 // Del mixin EventDispatcher
 public var addEventListener:Function;
 public var removeEventListener:Function;
 private var dispatchEvent:Function;

 function InteraccionUser(){
  EventDispatcher.initialize(this);
  Key.addListener(this);
  Mouse.addListener(this);
  //trace("nueva interacci�n creada")
 }
 function onKeyDown():Void{
  var ref = this;
  if(Key.isDown(Key.RIGHT)){
   ref.dispatchEvent({type:"onSiguiente"});
  }
  if(Key.isDown(Key.LEFT)){
   ref.dispatchEvent({type:"onAnterior"});
  }
  //trace("se ha pulsado una tecla")
 }
 function onMouseUp():Void{
  var ref = this;
  ref.dispatchEvent({type:"onSiguiente"});

 }
}
=========================================================

La clase que los recibe:

=========================================================
import mx.events.EventDispatcher;
class IronMan extends MovieClip{
 // Del mixin EventDispatcher
 public var addEventListener:Function;
 public var removeEventListener:Function;
 private var dispatchEvent:Function;


 //privadas
 private var datos:XML;
 private var userAction:InteraccionUser;
 private var diapoActual:Diapositiva;
 private var diapoAntigua:Diapositiva;
 private var posicionActual:Number;

 //p�blicas
 public var modelo:ListadoBD;

 // Constructor
 function IronMan(rutaxml:String){
  EventDispatcher.initialize(this);
  datos = new XML();
  modelo = new ListadoBD();
  userAction = new InteraccionUser();
  userAction.addEventListener(this);

  datos.ignoreWhite = true;
  var ref = this;
  datos.onLoad = function(ok:Boolean){
   ref.parsearDatos(ok);
  }

  if(rutaxml) cargar(rutaxml)
 }
  // Subscripciones

 function onSiguiente(){
  trace("siguiente")
 }
 function onAnterior(){
  trace("anterior")
 }
=========================================================


No saltan los eventos, y no se porqu� puede ser... �alguna idea?



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.9 - Release Date: 12/05/2005

----------------------------------
Lista ASNativos:[email protected]
http://www.5dms.com/listas
----------------------------------

Responder a