Reputation: 2684
I need some help forcing Flex3 to resize my TitleWindow component after an event.
My resize MXML looks like this:
<mx:Resize id="rs1" duration="1000"
heightTo="{radioVBox.y + radioVBox.height + 110}" />
How do I force it to resize after an event? I want to force the TitleWindow's height to change after the event in myFunc1 ends.
private function myFunc1():void {
//blah blah...
fe.addEventListener(FLASHEFFEvents.TRANSITION_END, myFunc2);
}
private function myFunc2():void {
//force the titleWindow's height to be resized-- call rs1
}
Any suggestions?
Thank you.
-Laxmidi
Upvotes: 0
Views: 1747
Reputation: 14221
I think it rather simple. For example we have a custom window and want it resizes on button click:
<?xml version="1.0" encoding="utf-8"?>
<mx:TitleWindow height="300" layout="absolute" width="400" xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<![CDATA[
import mx.events.EffectEvent;
protected function clickHandler():void
{
windowResize.play();
}
protected function windowResize_effectEndHandler(event:EffectEvent):void
{
trace("Effect ended");
}
]]>
</mx:Script>
<mx:Resize duration="1000" effectEnd="windowResize_effectEndHandler(event)" heightTo="200" id="windowResize"
target="{this}" />
<mx:Button click="clickHandler()" horizontalCenter="0" label="Resize" verticalCenter="0" />
</mx:TitleWindow>
Upvotes: 2
Reputation: 12847
You need to specify a target in your Resize tag for it to work, or specify the target when you call the resize.
<mx:Resize id="rs1" duration="1000" target="{yourTitleWindow}" heightTo="{radioVBox.y + radioVBox.height + 110}" />
rs1.play()
Personally, I don't like the Flex effect tags so I use TweenMax instead. In that case you'd just need to do this:
private function myFunc2():void
{
TweenMax.to(yourTitleWindow, 1, {height:radioVBox.y + radioVBox.height + 110});
}
Upvotes: 1