Open GoogleCodeExporter opened 9 years ago
I've been looking the code because I had the same problem as you, and found
what is
causing this. Another error was also thrown:
TypeError: Error #1034: Type Coercion failed: cannot convert
com.maclema.mysql.events::MySqlErrorEvent@1e22f71 to
com.maclema.mysql.events.MySqlEvent.
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
com.maclema.mysql::MySqlService/handleConnectError()[C:\workspaces\pixeltree\MyT
est\src\com\maclema\mysql\MySqlService.as:182]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
ErrorHandler()[C:\workspaces\pixeltree\MyTest\src\com\maclema\mysql\ErrorHandler
.as:18]
I've modified the code for correcting these issues as this:
com.maclema.mysql.mxml.MySqlService
line 91:
private function removeBusyCursor(e:MySqlEvent=null):void {
changed to:
private function removeBusyCursor(e:Event=null):void {
The listener was expecting an event with the type MySqlEvent, but as we can see
on
the constructor for the class, this method is registered as listener for 3
types of
event:
addEventListener(MySqlErrorEvent.SQL_ERROR, removeBusyCursor);
addEventListener(MySqlEvent.RESULT, removeBusyCursor);
addEventListener(MySqlEvent.RESPONSE, removeBusyCursor);
addEventListener(Event.CLOSE, removeBusyCursor);
The other error, reported by beuker.marcel, was corrected adding a clone()
method for
the class MySqlErrorEvent:
override public function clone():Event {
return new MySqlErrorEvent(msg, id);
}
Because the clone method wasn't overriden, it was returning an object from its
superclass type, ErrorEvent, instead of the expected MySqlErrorEvent.
Sorry for any english mistake :)
Original comment by pablotor...@gmail.com
on 26 Mar 2009 at 12:35
Excellent work. My solution was good enought for me at the time and I never
looked
much further into it, but your solution is proper. Thanks
Original comment by beuker.m...@gmail.com
on 26 Mar 2009 at 12:47
I've added the override to the clone method that Pablo suggested. In the
subversion
code the RemoveBusyCursor function had already been changed to accept anything
(e:* =
null). I've also changed the MySqlEvent class so that it has the correct
overrides
for the clone() and toString() methods.
Original comment by celeryn...@gmail.com
on 24 May 2009 at 4:23
Committed to subversion rev 178
Original comment by celeryn...@gmail.com
on 24 May 2009 at 9:19
Original comment by celeryn...@gmail.com
on 24 May 2009 at 9:25
Original issue reported on code.google.com by
beuker.m...@gmail.com
on 20 Jan 2009 at 8:49