Any issues?

Posted by florodebat 
Any issues?
November 27, 2009 02:07PM
Any issues?
Re: Any issues?
February 08, 2010 06:20PM
It seems that somewhere between when a FlashEff2Flex instance is added to the display-tree and a transition is started, the target is being re-parented with no regard to its layering in its parent displayobjectcontainer.

In the following example, the red and green rectangle swaps depths when clicking the green rectangle.

I was expecting the layering to stay the same and the container.parent to be the same as expected (the Main class instance).

Maybe I just downloaded a lemon revision of the flex component??

package {
	import com.jumpeye.Events.FLASHEFFEvents;
	import com.jumpeye.flashEff2.symbol.alpha.FESAlpha;

	import flash.events.MouseEvent;
	import flash.display.Sprite;

	/**
	 * A Document class to compile with the flex sdk compiler
	 */
	public class Main extends Sprite {
		private var myEffect:FlashEff2Flex;
		private var container:Sprite;
		private var overlay:Sprite;
		
		public function Main() {
			container = new Sprite();
			container.graphics.beginFill(0x00CC00, 1);
			container.graphics.drawRect(200, 100, 300, 200);
			container.graphics.endFill();
			addChild(container);
			
			overlay = new Sprite();
			overlay.graphics.beginFill(0xCC0000, 1);
			overlay.graphics.drawRect(50, 50, 300, 200);
			overlay.graphics.endFill();
			addChild(overlay);
			
			container.buttonMode = true;
			container.addEventListener(MouseEvent.CLICK, onClick);
		}

		private function onClick(event : MouseEvent) : void {
			trace("onClick() container.parent: "+container.parent);
			myEffect = new FlashEff2Flex();
			myEffect.addEventListener(FLASHEFFEvents.TRANSITION_END, onTransitionEnd, false, 0, true);
			myEffect.showAutoPlay = false;
			myEffect.hideDelay = 0;
			addChild(myEffect);
			myEffect.target = container;
			
			var showPattern:FESAlpha = new FESAlpha();
			showPattern.preset = 13;
			showPattern.tweenDuration = 0.5;
			myEffect.showTransition = showPattern;
			myEffect.show();
		}

		private function onTransitionEnd(event : FLASHEFFEvents) : void {
			trace("onClick() container.parent: "+container.parent);
		}
	}
}

Re: Any issues?
February 24, 2010 08:52AM
electricrainmaker,

Indeed the flasheff target is placed into the flasheff container and the flasheff instance is the last added object in your code . To avoid that you can use the "addChildAt()" method in order to add the flasheff instance on a certain index.
Re: Any issues?
March 04, 2010 10:48AM
Thx for the reply.

I'll try it out

edit:
so, for future forum use, the FlashEff2Flex instance should be inserted in the level where you want the transition to happen.


regards



Edited 2 time(s). Last edit at 03/04/2010 11:23AM by electricrainmaker.
Re: Any issues?
March 24, 2010 04:07PM
electricrainmaker,

You are welcome!
Sorry, you do not have permission to post/reply in this forum.