Actor not forwarding events
This is less of a problem and more of an observation. If i have an Actor that forwards events from another class, if clone() is not overriden within the Event class that's being forwarded, it just fails silently and no event is dispatched.
protected function myEventHandler( event:MyEvent ):void
{
dispatch( event );
}
I'm currently porting a project to RL that previously used the display list as an event bus, so it wasn't necessary to override clone within the custom events that were being bubbled. I realise this possibly isn't best practice, but never the less, without a clone method declared within the event, it just fails silently with RL without any error or warning,
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by creynders on 07 Aug, 2010 11:55 AM
That's a flash player issue, not RL. From the AS3 help files:
Obviously this applies to the
type
property as well, therefore it fails silently; the event is redispatched, but the type property is empty.You should make it a custom to ALWAYS override the clone method of Event subclasses.
2 Posted by jamesr on 07 Aug, 2010 12:24 PM
true, but if you try to re-dispatch a custom Event object, doesn't it usually throw an Error if you haven't override the clone method?
3 Posted by jamesr on 07 Aug, 2010 01:26 PM
sorry, i realise i'm talking rubbish. The error's thrown when a handler that's expecting a certain event type receives an Event instead. This obviously wouldn't happen in RL as the the Event type is also checked.
Stray closed this discussion on 10 Feb, 2011 05:33 PM.