jiangtiandao / flexlib

Automatically exported from code.google.com/p/flexlib
0 stars 0 forks source link

MDIWindow resize event throws error #244

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Registering a function to listen to the resize event on MDIWindow throws
the following error:

TypeError: Error #1034: Type Coercion failed: cannot convert
mx.events::ResizeEvent@10e1cd41 to flexlib.mdi.events.MDIWindowEvent.
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\fram
ework\src\mx\core\UIComponent.as:9298]
    at
mx.core::UIComponent/dispatchResizeEvent()[C:\autobuild\3.2.0\frameworks\project
s\framework\src\mx\core\UIComponent.as:7077]
    at
mx.core::UIComponent/commitProperties()[C:\autobuild\3.2.0\frameworks\projects\f
ramework\src\mx\core\UIComponent.as:5869]
    at
mx.core::Container/commitProperties()[C:\autobuild\3.2.0\frameworks\projects\fra
mework\src\mx\core\Container.as:2616]
    at
mx.containers::Panel/commitProperties()[C:\autobuild\3.2.0\frameworks\projects\f
ramework\src\mx\containers\Panel.as:1130]
    at
mx.core::UIComponent/validateProperties()[C:\autobuild\3.2.0\frameworks\projects
\framework\src\mx\core\UIComponent.as:5807]
    at
mx.managers::LayoutManager/validateClient()[C:\autobuild\3.2.0\frameworks\projec
ts\framework\src\mx\managers\LayoutManager.as:811]
    at
mx.core::UIComponent/validateNow()[C:\autobuild\3.2.0\frameworks\projects\framew
ork\src\mx\core\UIComponent.as:5679]
    at
flexlib.mdi.managers::MDIManager/executeDefaultBehavior()[/Users/dougmccune/Docu
ments/Flex
Builder Moxie/flexlib/trunk/src/flexlib/mdi/managers/MDIManager.as:486]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
flexlib.mdi.managers::MDIManager/windowEventProxy()[/Users/dougmccune/Documents/
Flex
Builder Moxie/flexlib/trunk/src/flexlib/mdi/managers/MDIManager.as:445]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at
mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.2.0\frameworks\projects\fram
ework\src\mx\core\UIComponent.as:9298]
    at
flexlib.mdi.managers::MDIManager/bringToFront()[/Users/dougmccune/Documents/Flex
Builder Moxie/flexlib/trunk/src/flexlib/mdi/managers/MDIManager.as:734]
    at flexlib.mdi.managers::MDIManager/add()[/Users/dougmccune/Documents/Flex
Builder Moxie/flexlib/trunk/src/flexlib/mdi/managers/MDIManager.as:301]

Original issue reported on code.google.com by Me.S...@gmail.com on 5 Sep 2009 at 10:14

GoogleCodeExporter commented 8 years ago
I've encountered this issue as well.  MDIWindow generates the 
MDIWindowEvent.RESIZE 
event on resizing.  It's parent class Panel generates ResizeEvent.RESIZE.  It 
appears 
to be caused by MDIWindowEvent.RESIZE and ResizeEvent.RESIZE both being the 
constant 
"resize", which causes confusion in the flex event dispatcher.  Until the code 
is 
fixed to use a unique event name, you can workaround this issue by manually 
adding an 
event listener instead of using binding, i.e. 
this.addEventListener(ResizeEvent.RESIZE, resizeHandler); 
instead of 
<MDIWindow resize="resizeHandler(event)">

Not sure why the mxml generates the error but actionscript doesn't, but there 
you go.

Original comment by por...@gmail.com on 22 Dec 2009 at 12:00