Embarrassingly, yes.
Thanks :-)
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ben.clinkinbeard
Sent: 01 November 2007 18:04
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Why can't I dispatch a different event from an
event handler?
Does UploadDialogEvent.SELECT_FILES evaluate to a string that has a
MouseEvent listener assigned to it?
Ben
--- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
, Mark Ingram [EMAIL PROTECTED] wrote:
I have the following code:
private function browseButton_clickHandler(event:MouseEvent):void
{
var uiEvent:UploadDialogEvent = new
UploadDialogEvent(UploadDialogEvent.SELECT_FILES);
this.dispatchEvent(uiEvent);
}
Which throws the following error:
TypeError: Error #1034: Type Coercion failed: cannot convert
com.softease.honeycomb.events.ui::[EMAIL PROTECTED] to
flash.events.MouseEvent.
However, the following code works just fine!
private function publishButton_clickHandler(event:MouseEvent):void
{
var publishDialogEvent:PublishDialogEvent = new
PublishDialogEvent(PublishDialogEvent.PUBLISH,
passwordTextInput.text);
this.dispatchEvent(publishDialogEvent);
}
Both UploadDialogEvent and PublishDialog event inherit from a custom
UIEvent class (which just sets bubbling = true). So why does it work
fine in one case and not in another case?!
The only difference as far as I can see is that a custom parameter is
passed through to the PublishDialogEvent - but why would that make a
difference??
Mark