Usually what happens with effects is they set the explicit width and height of a component. This means that before you minimize the container, these values are not set. When you minimize the container, the explicitWidth and explicitHeight are set. Normally a layout or container will size the component with setActualSize() or setLayoutBoundsSize(). This does not lock the component into an explicit state.
Sometiems after an effect I call;
myComponent.width = NaN; myComponent.height = NaN;
This will reset the explicit values to NaN and force the component's layout to re-measure and layout out based on it's preferred sizes. In your case, before the minimize effect occured
Mmmh...that does not seem to solve the issue for me. Even when setting the width and height to NaN before the effect is played, it will still lead to a fixed height and width of the parent panel container. When I add new children the parent container is not properly resized, means that the chiildren just go beyond the parent container's border.
Setting these parameters after the effect is done leads to the following crash:
ArgumentError: Error #2004: One of the parameters is invalid.
at spark.accessibility::PanelAccImpl/eventHandler()[E:\dev\4.0.0\frameworks\projects\spark\s rc\spark\accessibility\PanelAccImpl.as:361]
at mx.core::UIComponent/dispatchEvent()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\co re\UIComponent.as:12266]
at mx.core::UIComponent/dispatchResizeEvent()[E:\dev\4.0.0\frameworks\projects\framework\src \mx\core\UIComponent.as:9641]
at mx.core::UIComponent/commitProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\mx \core\UIComponent.as:7866]
at spark.components.supportClasses::SkinnableComponent/commitProperties()[E:\dev\4.0.0\frame works\projects\spark\src\spark\components\supportClasses\SkinnableComponent.as:414]
at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:730]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]
Here is my code...anything wrong here.
private function recreateWindow(e:MouseEvent)//thrown once the user moves his mouse over the minimized panel
myResizeEffect.heightFrom = 40;
myResizeEffect.heightFrom = 40;
myResizeEffect.heightFrom = lastHeight;
myResizeEffect.heightFrom = lastWidth;
private function resetMinimizeValues(event:EffectEvent):void
//adding the old listeners before the panel was minimized
this.width = NaN;//crash
this.height = NaN;//crash
...and how can I remove the "Question answered"-tag...?
I could help with this but not knowing exactly how you are doing things, it's a wasted guess.
Can you create a small app that reproduces what you are doing?
Those values sholdn't be called in the effectEnd handler since the component has not yet validated again.
thanks for your help. I left you a fxp in that rar-file:
The error also appears there. As I said working with NaN just crashes the whole application, I am a bit lost here
I've tried playing around with it a bit more, but still no luck.
Even if I call this.setLayoutBoundsSize(), the children are not influenced by that...any suggestions?