<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: Blur Transition Effect (updated for Flash 8+)]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Tue, 24 Nov 2009 15:21:20 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/553/1/Blur-Transition-Effect-updated-for-Flash-8/Page1.html#Comment2796</link><description><![CDATA[Very Helpful! Thank You!

I made a helpful function out of this if you're interested:

//-------------------------------------------------------

import mx.transitions.*;
import mx.transitions.easing.*;
import flash.filters.BlurFilter; 

_root.tweenBlur = function(my_mc, fromBlur, toBlur, duration, afterFunc){	
	var blur:BlurFilter = new BlurFilter(fromBlur, fromBlur, 3); 
	my_mc.filters = new Array(blur); 	
	blurTween = new Tween(blur, "blurX", _root.easeType, blur.blurX, toBlur, duration, true); 
	blurTween.onMotionChanged = function() { 
	  blur.blurY = blur.blurX; 
	  my_mc.filters = new Array(blur); 
	} 	
	if(afterFunc) blurTween.onMotionFinished = afterFunc; // This will run a function when the blur is complete
}<br/><br/>
(Comment posted by Gabe Coyne at 7:03 pm, Wed 2nd May 2007)]]></description><author>no@spam.com (Gabe Coyne)</author><pubDate><![CDATA[Wed, 02 May 2007 19:03:39 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/553/1/Blur-Transition-Effect-updated-for-Flash-8/Page1.html#Comment2796</guid></item><item><title><![CDATA[Comment #2]]></title><link>http://www.actionscript.org/resources/articles/553/1/Blur-Transition-Effect-updated-for-Flash-8/Page1.html#Comment4285</link><description><![CDATA[Hi,

I'm trying to make a class which has a movie clip data member and the same method as you presented above, but it isn't working.  I'm sure I'm doing something silly within the class.  The original blur is set, but the roll events don't work.  The class is as follows:

---------------------------------------------------------


import flash.filters.BlurFilter;
import mx.transitions.Tween;
import mx.transitions.easing.*;
import MyMath;
import MyDraw;
import MyColor;

class MySquare
{

	// Data Members
	public static var count:Number = 0;
	public static var SIZE:Number = 50;
	public var mc:MovieClip;
	public var blur:BlurFilter;
	public var blurTween:Tween;

	// Constructor
	public function MySquare(timeline:MovieClip) {

		// Create a uniquely name movie clip instance
		var name:String = "square"+count+"_mc";
	
		var depth:Number = MyMath.randomInteger(2,_global.MAX_DEPTH);
		
		// Create a new square
		this.mc = timeline.createEmptyMovieClip(name, depth);
		//this.mc = timeline.mc;
		
		var color:Number = MyColor.randomColor();
		
		MyDraw.drawSquare(mc, SIZE, color, 100);
		
		// set the position
		mc._x = MyMath.randomInteger(0,Stage.width-SIZE);
		mc._y = MyMath.randomInteger(0,Stage.height-SIZE);
		
		// set the blur
		var blurValue:Number = Math.abs(depth-_global.focus_depth);
		//var blur:BlurFilter = new BlurFilter(blurValue,blurValue,3);
		blur = new BlurFilter(blurValue,blurValue,3);
		mc.filters = [blur];
		
		// Increment the number of MySquare objects in existence
		count++;
		
		mc.onPress = function() {
			this.startDrag();
		}
		
		mc.onRelease = function() {
			this.stopDrag();
		}
		
		mc.onRollOver = function() {
			
			blur = mc.filters[0];
			blurTween = new Tween(blur, "blurX", Strong.easeOut, blur.blurX, 0, 1.0, true);
			blurTween.onMotionChanged = function() {
				blur.blurY = blur.blurX;
				mc.filters[0] = [blur];
			}
			
		}

		mc.onRollOut = function() {
			
			var blurValue:Number = Math.abs(mc.getDepth()-_global.focus_depth);

			blurTween = new Tween(blur, "blurX", Strong.easeOut, blur.blurX, blurValue, 1.0, true);
			blurTween.onMotionChanged = function() {
				blur.blurY = blur.blurX;
				mc.filters = [blur];
			}

		}

	}

}

---------------------------------------------------------

Any ideas?
Thanks in advance,
Craig<br/><br/>
(Comment posted by Craig at 1:28 am, Sat 30th Jun 2007)]]></description><author>no@spam.com (Craig)</author><pubDate><![CDATA[Sat, 30 Jun 2007 01:28:48 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/553/1/Blur-Transition-Effect-updated-for-Flash-8/Page1.html#Comment4285</guid></item><item><title><![CDATA[Comment #3]]></title><link>http://www.actionscript.org/resources/articles/553/1/Blur-Transition-Effect-updated-for-Flash-8/Page1.html#Comment4730</link><description><![CDATA[Very very cool.. 
I did a lil conversion so this script works from the object actions.. rather than the root timeline actions.. 

Let me know if I goofed at all.. I'm going to try to optimize it a bit here in a sec.. Well, here it is.

onClipEvent(load)
{
import flash.filters.BlurFilter;
import mx.transitions.Tween;
import mx.transitions.easing.Strong;

var totalBlur:Number = 8;
var noBlur :Number = 0;

var blur:BlurFilter = new BlurFilter(totalBlur, totalBlur, 3);
this.filters = new Array(blur);
 
var blurTween:Tween;
this.onRollOver = function() {
	trace("I've been called:  " );
   blurTween = new Tween(blur, "blurX", Strong.easeOut, blur.blurX, noBlur, 1, true);
   blurTween.onMotionChanged = function() {
      blur.blurY = blur.blurX;
	   trace("blurX: " + blur.blurX + filters) ;
      filters = new Array(blur);
	 
   }
}

this.onRollOut = function() {
   blurTween = new Tween(blur, "blurX", Strong.easeOut, blur.blurX, totalBlur, 1.0, true);
   blurTween.onMotionChanged = function() {
   blur.blurY = blur.blurX;
   filters = new Array(blur);
   } 
}	
}<br/><br/>
(Comment posted by sNovak at 7:14 pm, Tue 17th Jul 2007)]]></description><author>no@spam.com (sNovak)</author><pubDate><![CDATA[Tue, 17 Jul 2007 19:14:21 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/553/1/Blur-Transition-Effect-updated-for-Flash-8/Page1.html#Comment4730</guid></item></channel></rss>