[Flashcoders] cloning custon events

2011-05-06 Thread Mattheis, Erik (MIN-WSW)
I've an app that passes events outside of the DisplayList from one class to 
another. 

In my extended CustDataEvent class:

public var param:*;

public function CiustDataEventç(type:String, bubbles:Boolean = true, 
cancelable:Boolean=false, param:* = null) {
  super(type, bubbles, cancelable);
}

public override function clone() :  Event {
  return new FirebellDataEvent(type, bubbles, cancelable, param);
}

I would like to just say:

private function sitePropertyUpdatedHandler(e:CustDataEvent) : void {
  dispatchEvent(e);
}

but to have the event param passed on I have to say:

private function sitePropertyUpdatedHandler(e:CustDataEvent) : void {
  var evt = new FirebellDataEvent(CustDataEvent.SITE_PROPERTY_UPDATED);
  evt.param = e.param;
  dispatchEvent(evt);
}

What am I not understanding? I suspect I may have to pass the param as an 
argument to CustDataEvent

Can I super the param to Event somehow? ZForgive me if I introduced errors 
while simplifying the code.


- Erik Mattheis
612 377 2272
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


Re: [Flashcoders] cloning custon events

2011-05-06 Thread Paul Andrews

On 06/05/2011 08:03, Mattheis, Erik (MIN-WSW) wrote:

I've an app that passes events outside of the DisplayList from one class to 
another.

In my extended CustDataEvent class:

public var param:*;

public function CiustDataEventç(type:String, bubbles:Boolean = true, 
cancelable:Boolean=false, param:* = null) {
   super(type, bubbles, cancelable);
}

public override function clone() :  Event {
   return new FirebellDataEvent(type, bubbles, cancelable, param);
}

I would like to just say:

private function sitePropertyUpdatedHandler(e:CustDataEvent) : void {
   dispatchEvent(e);
}

but to have the event param passed on I have to say:

private function sitePropertyUpdatedHandler(e:CustDataEvent) : void {
   var evt = new FirebellDataEvent(CustDataEvent.SITE_PROPERTY_UPDATED);
   evt.param = e.param;
   dispatchEvent(evt);
}

What am I not understanding? I suspect I may have to pass the param as an 
argument to CustDataEvent


var evt = new FirebellDataEvent(CustDataEvent.SITE_PROPERTY_UPDATED, true, 
false, e.param);
// intermediate parameters to taste

You seem to have FirebellDataEvent and CustDataEvent mixed up. Perhaps it 
should be CustDataEvent only?



Can I super the param to Event somehow? ZForgive me if I introduced errors 
while simplifying the code.


- Erik Mattheis
612 377 2272
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders



___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders