Jump to content
Search Community

SOLVED-dynamicTween-LiquidArea-MotionBlurPlugin-problem

peteragentweb test
Moderator Tag

Recommended Posts

Hi,

I'm testing some of the stuff i purchased yesterday. I'm very glad, but i've got one question :

Is it possible to use motion blur pluggins with dynamicTween and LiquidArea ?

I try this and it doesn't seem to work : :|

package com.peteragentweb.atelierblick.labo {
import com.greensock.plugins.TweenPlugin;	
import com.greensock.easing.Quint;	
import com.greensock.layout.AlignMode;	
import com.greensock.layout.ScaleMode;	
import com.greensock.layout.LiquidArea;
import com.greensock.plugins.MotionBlurPlugin;

import flash.events.MouseEvent;	

import com.greensock.layout.LiquidStage;	

import flash.display.StageQuality;	
import flash.display.StageScaleMode;	
import flash.display.StageAlign;	
import flash.display.MovieClip;

/**
 * @author peteragentweb
 */
public class LayoutTest extends MovieClip {
	private var ls : LiquidStage ;
	private var area : LiquidArea ;
	private var area2 : LiquidArea ;
	private var menuIsDeployed : Boolean = false;

	public function LayoutTest() {
		stage.align = StageAlign.TOP_LEFT;
		stage.scaleMode = StageScaleMode.NO_SCALE;
		stage.quality = StageQuality.BEST;
		TweenPlugin.activate([MotionBlurPlugin]);

		var mc : MovieClip = this["mc2"];
		mc.buttonMode = true;
		mc.addEventListener(MouseEvent.ROLL_OVER, over);
		mc.addEventListener(MouseEvent.ROLL_OUT, out);
		var mc2 : MovieClip = this["mc"];
		ls = new LiquidStage(this.stage, 900, 600, 900, 600);
		area = new LiquidArea(this, 0, 570, 900, 300, 0x0000FF);
		area.attach(mc, ScaleMode.STRETCH);
		area2 = new LiquidArea(this, 0, -550, 900, 550, 0xEEEEEE);
		area2.attach(mc2, ScaleMode.HEIGHT_ONLY, AlignMode.LEFT,  AlignMode.CENTER );
	}

	private function over(e : MouseEvent) : void {
		if(!menuIsDeployed) {
			area.dynamicTween(.4, {y:ls.stage.stageHeight - 300, ease:Quint.easeInOut, onComplete:complete, motionBlur:{strength:3, quality:3}});
			area2.dynamicTween(.441, {y:-area2.height + 30, ease:Quint.easeInOut, motionBlur:{strength:3, quality:3}});
		}
	}

	private function out(e : MouseEvent) : void {
		if(menuIsDeployed) {
			area.dynamicTween(.41, {y:ls.stage.stageHeight - 30, ease:Quint.easeInOut, onComplete:complete, motionBlur:{strength:3, quality:3}});
			area2.dynamicTween(.41, {y:10, ease:Quint.easeInOut, motionBlur:{strength:3, quality:3}});
		} else {
		}
	}

	private function complete() : void {
		menuIsDeployed =!menuIsDeployed;
	}
}
}

 

have you any suggestion, ?

Thank You.

 

*EDIT : perhaps, the motion doesn't affect tel liquidareas?

Link to comment
Share on other sites

I don't see anywhere that you're adding the LiquidArea to the display list, so you'd never see the motionBlur. Remember, LiquidArea is NOT a container, so when you attach() objects, they're not getting added as children of that LiquidArea. This is actually a very good thing because it means LiquidArea is respecting your heirarchy and doesn't force you to nest things differently. Think of it almost like a background that, when resized/moved, forces the attached objects to move/scale accordingly.

 

If you want to see the LiquidArea, you can either addChild() to your container or just set the "preview" property to true.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...