The resize effect won't restore the size until the effect actually starts so that's the cause of the flicker. You can either delay setting the width by 200ms, or use a different easingFunction. We'd recommend easing functions because they will give immediate feedback but still appear like there is a delay. Sample functions are in mx.easing
Not sure why you have a problem if there is no start delay. Do you have a simplified version of that issue? Is the width being changed based on a button as well or some other way? ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of dorkie dork from dorktown Sent: Tuesday, January 02, 2007 4:13 PM To: [email protected] Subject: Re: [flexcomponents]How do I check if an effect is in effect? Alex, I think this reproduces the effect. At least on my machine. <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml <http://www.adobe.com/2006/mxml> " layout="absolute" xmlns:filters="flash.filters.*"> <mx:Script> <![CDATA[ private var _flag:Boolean; public function displayNewsItems():void { var finalX:Number = stage.width -200; // close banner items if (_flag) { menu.width = 485; //menu.validateNow() } else { //menu.setActualSize(stage.width -200,menu.height); menu.width = finalX; //menu.validateNow() } _flag = !_flag } ]]> </mx:Script> <mx:Resize id="resize1" duration="1000" suspendBackgroundProcessing="true" target="{menu}" startDelay="200"/> <mx:HBox y="70" height="20" verticalAlign="bottom" horizontalGap="0" id="menu" left="0" width="485" resizeEffect="{resize1}"> <mx:HBox verticalAlign="middle" horizontalGap="0" backgroundColor="#000000" height="100%" width="100%" > <mx:Spacer width="100%"/> <mx:Label text="800.333.4444" color="#ebebeb" fontWeight="bold" fontSize="8"/> <mx:Label text="TECH" fontWeight="bold" fontSize="8" color="#ffff3d"/> <mx:Image source="images/YBNET-Phone-Icon.png"/> <mx:Label text="HELPDESK" fontWeight="bold" fontSize="8" color="#ffff3d"/> <mx:Label text=" 877.444.5555" color="#ebebeb" fontWeight="bold" fontSize="8"/> </mx:HBox> <mx:Image source="images/YBNET-Banner-Edge.png" autoLoad="true"/> </mx:HBox> <mx:Button x="10" y="10" label="Button" click="displayNewsItems()"/> </mx:Application> If you remove the startDelay I believe then it starts to work. But I have another project where start delay is not applied. The effect appears as below. <mx:Move id="move1" duration="500" target="{myframe}" /> On 12/28/06, Alex Harui < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Call validateNow() after changing the height or use the move() method and see if the flicker goes away. ________________________________ From: [email protected] <mailto:[email protected]> [mailto:[email protected] <mailto:[email protected]> ] On Behalf Of dorkie dork from dorktown Sent: Wednesday, December 27, 2006 2:28 PM To: [email protected] <mailto:[email protected]> Subject: Re: [flexcomponents]How do I check if an effect is in effect? The effect is defined in a mxml application that I use to test the component. Here is a code snippet. <mx:Button x="573" y="135" label="Higher" click="{component1.height = component1.height + increment}"/> <mx:Button x="418" y="120" label=">" click="{component1.move(component1.x + increment,component1.y)}"/> <ns1:mycomp id="component1" moveEffect="move1" borderStyle="solid" borderThickness="4" y="190" width="674" x="30"/> <mx:Move id="move1" duration="500" target="{component1}" /> The reason that I want to check for an effect is that when I move the component using the move method or set the width the component moves to the location instantly and then the tween instance snaps the component back to the start position of the tween and then carries it through as it should. So there is this flicker of the component going to the final position or size and then snapping back before the start of the tween. I traced it out and you can see the first value in the move listener function is the final desired value. Values after that are syncronized with the move effect. For example, I added a listener to the move method. The component x coordinate is 30. I click the button to move the component to 80. Here is the trace statement in the moveHandler: // adding event handler addEventListener(MoveEvent.MOVE,moveHandler); // move handler public function moveHandler(event:MoveEvent):void { trace("move to ", x); // console output move to 90 <-- notice this first value move to 30 move to 30.6 move to 32.2 move to 35.050000000000004 move to 38.900000000000006 move to 43.6 move to 48.050000000000004 move to 52.150000000000006 move to 55.45 move to 59.2 move to 63.550000000000004 move to 67.45 move to 71.55 move to 74.75 move to 78.2 move to 81.2 move to 84 move to 85.9 move to 87.80000000000001 move to 89.05000000000001 move to 89.80000000000001 move to 90 On 12/27/06, Alex Harui <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > wrote: Where is the move effect defined? Any effect dispatches events when it starts and stops (effectStart, effectEnd) ________________________________ From: [email protected] <mailto:[email protected]> [mailto:[email protected] <mailto:[email protected]> ] On Behalf Of dorkie dork from dorktown Sent: Tuesday, December 26, 2006 4:49 PM To: [email protected] <mailto:[email protected]> Subject: [flexcomponents]How do I check if an effect is in effect? How do I check if an effect is in effect? My component is listening to the move event and runs some code when the component is moved. But if there is a move effect then I need to handle things differently. addEventListener( MoveEvent.MOVE,moveHandler); public function moveHandler(event:MoveEvent):void { if (effectIsRunning) { // do something } else { // do something else } } dorkie in full effect dork from dorktown
