No Effects in Spark TitleWindow via PopUp Manager

Posted by user818516 
No Effects in Spark TitleWindow via PopUp Manager
July 04, 2011 11:21PM
I admit I just purchased FlashEffFlex today so I am new to this component but I can't seem to get FlashEffFlex effects to run in a Spark TitleWindow (4.5) initiated by the PopUp Manager.

See examples below. The View Source is enabled so you can right click to see that the only difference is one runs in the root application as where the other in a titleWindow component.

Example 1 (runs in root application)
http://emarket101.com/FlashEff2Flex/root/FlashEff2Flex_RootApplication.html

Example 2 (does not run in titleWindow)
http://emarket101.com/FlashEff2Flex/titlewin/FlashEff2Flex_SparkTitleWindow.html

Any suggestions are much appreciated. I have also created a support ticket regarding this issue.



Edited 1 time(s). Last edit at 07/04/2011 11:28PM by user818516.
Re: No Effects in Spark TitleWindow via PopUp Manager
July 06, 2011 08:15PM
For anyone else having this issue Adrian Moza came up with this workaround which did work in this situation.

http://emarket101.com/FlashEff2Flex/titlewin/FlashEff2Flex_SparkTitleWindow.html

From Adrian:

The problem is that onComplete the image bounds are zero(the flasheff is getting the bounds from the target in order to create masks and other elements needed for the effect to run) and therefore flasheff is applying an effect on a object with zero bounds width and height. The only workaround that I could find at this moment, was to to create the effect only after one frame.
I attached the class with the modified code.

<?xml version="1.0" encoding="utf-8"?>
<s:TitleWindow xmlns:fx="[ns.adobe.com]; 
			   xmlns:s="library://ns.adobe.com/flex/spark" 
			   xmlns:mx="library://ns.adobe.com/flex/mx" 
			   width="820" height="620">
	
	<s:Image id="myImage" width="800" height="600" 
			 horizontalCenter="0" verticalCenter="0"
			 source="myImage.jpg" complete="loadComplete()"/>
	
	<fx:Script>
		<![CDATA[
			
			import FlashEff2Flex
			
			import com.jumpeye.Events.FLASHEFFEvents;
			import com.jumpeye.flashEff2.symbol.brightSquares.FESBrightSquares;
			import com.jumpeye.flashEff2.symbol.equalizer.FESEqualizer;
			
			private var myEffect:FlashEff2Flex;
			private var showEffect:FESBrightSquares;
			private var hideEffect:FESEqualizer;
			private var count:uint=0
			private function loadComplete():void {
				myImage.visible=false
				addEventListener(Event.ENTER_FRAME, enterFrameHandler)
				
			}

			private function enterFrameHandler(ev:Event):void{
				count++
				if(count>=1){
					removeEventListener(Event.ENTER_FRAME, enterFrameHandler)
					trace("removeEnterFrame")
					myImage.visible=true
					myEffect = new FlashEff2Flex();
					myEffect.target = myImage;
					addElement(myEffect);
					showEffect = new FESBrightSquares();
					showEffect.squareWidth = 20
					showEffect.squareHeight = 20;
					showEffect.tweenDuration = 2;
					myEffect.showTransition = showEffect;
					hideEffect = new FESEqualizer();
					hideEffect.equalizerPercentage = 50;
					hideEffect.tweenDuration = 2;
					myEffect.hideTransition = hideEffect;
					
					myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, restartShowEffect);

				
				}
			
			}

			
			private function restartShowEffect(evt:FLASHEFFEvents):void {
				// Once the hide transition has endded, restart the show transition.
				var effectInstance:FlashEff2Flex = evt.target as FlashEff2Flex;
				if (effectInstance.currentTransitionType == "hide")
					effectInstance.show();
			}
			
		]]>
	</fx:Script>
</s:TitleWindow>
Re: No Effects in Spark TitleWindow via PopUp Manager
July 07, 2011 12:06PM
You might call myImage.validateNow() to force an instant update.



Edited 1 time(s). Last edit at 07/07/2011 12:07PM by krumedia.
Sorry, you do not have permission to post/reply in this forum.