Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Unable To Apply Blur Filter



The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc,picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidanceimport flash.display.BitmapData;import flash.geom.Point;import flash.geom.Rectangle;import flash.filters.BlurFilter;var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);init = function () { currentIndex = 1; currentLayer = 1; howLongToWait = 0; _root.attachMovie("picture1_mc", "pic1", 0); addNewPic();};addNewPic = function () { clearInterval(myInterval); if (currentIndex%3 != 0) { currentIndex++; } else { currentIndex = 1; } newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++); newlyAdded_mc._alpha = 0; newlyAdded_mc.onEnterFrame = function() { this._alpha += 2; if (this._alpha>=100) { this.onEnterFrame = null; myInterval = setInterval(addNewPic, howLongToWait*100); } };};// run init()init();onMouseDown = function () { //problems here!!!!!!!!! var pointoint = new Point(_root._xmouse, _root._ymouse); var rec:Rectange = new Rectangle(100,100,6,6); //problem applying filter //????.applyFilter(?????,rect,point,filter2)};myListener = new Object();Mouse.addListener(myListener);



KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 01-19-2007, 03:48 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Unable To Apply Blur Filter On Mouse Down Event
The code below fades three mc instances into each other. The movieclip instances are called, picture1_mc, picture2_mc, picture3_mc. They are based on three bitmap images that also sit in the library. I manually converted the original bitmaps into movieclips on the stage area. The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along. My problem is that Im not sure how to apply this within my mousedown function. The applyFilter method seems to call for bitmaps but I'm dealing with movieclips. Thanks for any guidance

import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);

init = function () {
currentIndex = 1;
currentLayer = 1;
howLongToWait = 0;
_root.attachMovie("picture1_mc", "pic1", 0);
addNewPic();
};
addNewPic = function () {
clearInterval(myInterval);
if (currentIndex%3 != 0) {
currentIndex++;
} else {
currentIndex = 1;
}
newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
newlyAdded_mc._alpha = 0;
newlyAdded_mc.onEnterFrame = function() {
this._alpha += 2;
if (this._alpha>=100) {
this.onEnterFrame = null;
myInterval = setInterval(addNewPic, howLongToWait*100);
}
};
};
// run init()
init();
onMouseDown = function ()
{
//problems here!!!!!!!!!
var point:Point = new Point(_root._xmouse, _root._ymouse);
var rec:Rectange = new Rectangle(100,100,6,6);
//problem applying filter
//????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);

How To Apply Blur Filter On Image In Different Layer?
I have one load which loads image randomly from external folder.

and another layer which has 5 columns. I wish to do a mouse over thing and one of the column will become blur.


I tried to use the blur filter, but can't seem to get it work on image that loads randomly from external folder.

this is the action script code I used for loading external images:

Quote: pic_arr = ["images/1", "images/2", "images/3", "images/4", "images/5"];
onLoad = function() {
ranNum = Math.floor(Math.random()*pic_arr.length);
holder_mc.loadMovie(pic_arr[ranNum]+".jpg");
};



any help?

Bitmapdata, Apply Filter To One Channel? Realease A Filter
Hi there, I have two question:

Is it possible to apply a filter only to one channel or to access only one channel?
I've found somewhere:
Display.BitmapData.Channel.ALPHA
Is it something we can access at runtime?


When I appply a filter to a Bitmapdata, the Bitmapdata isn't really modified but just filtered, so if for example I copy one of its channel to another bitmapdata, I copy the source bitmap without the filter...
What I'd like to do is "release" the filter so it definetely modify the image. Is it a function to do so or can I only perform this by doing a screenshot of my MovieClip?


Thank you inadvance for your help.

Blur Filter - Need To Blur Only The Objects At The Edge Of The Stage.
Hi everyone! I have created a slideshow which pulls in images with xml and then places them in a horizontal row in the middle of the stage. I have a previous and next button which cycles through the images.

I am trying to make the images blurry except for the one that is front and center on the screen. As you cycle through the images, they are blurry until they get to the center. How would I go about doing this?

I have imported the BlurFilter, but when I apply it to the imageholder mc, all of the images are blurry. How can I tell it to not blur the one currently in the center of the stage?

Thanks!

Blur Filter - Need To Blur Only The Objects At The Edge Of The Stage.
Hi everyone! I have created a slideshow which pulls in images with xml and then places them in a horizontal row in the middle of the stage. I have a previous and next button which moves this row of images left and right on the x axis.

I am trying to make the images blurry except for the one that is front and center on the screen. As you cycle through the images, they are blurry until they get to the center. How would I go about doing this?

I have imported the BlurFilter, but when I apply it to the imageholder mc, all of the images are blurry. How can I tell it to not blur the one currently in the center of the stage?

Colormatrix Filter And Blur Filter Tween
Last edited by sks447 : 2006-10-17 at 15:11.
























I want to have a picture fade from blurry and grayscale to sharp and colorized. I have the blur to sharp part working ok. I have the grayscale to color to working ok. The only thing is the filters dont work together. Ive tried to push one into another with no luck yet. You can see the comments in the code below. Thanks.

ActionScript Code:
function blurFunction(myVar) {
    // init what movieclip to blur
    if (myVar == undefined) {
        myVar = promoContainer.p1;
    }
    // BLUR FILTER     
    import flash.filters.BlurFilter;
    import flash.filters.BitmapFilter;
    import flash.filters.ColorMatrixFilter;
    var blurFilter:BlurFilter = new BlurFilter(0, 0, 3);
    desaturation = 1;
    var filterArray:Array = new Array();
    filterArray.push(blurFilter);
    var blurX:Number = 100;
    var blurY:Number = 100;
    onEnterFrame = function () {
        prevPromo._visible = false;
        nextPromo._visible = true;
        if (desaturation>=1) {
            des = -0.03;
        } else if (desaturation<=0) {
            des = 0;
            delete (onEnterFrame);
        }
        desaturation += des;
        // color matrix 
        //myVar.filters = new Array(getDesaturationFilter(desaturation)); <---- I can have this....
        blurX -= 10;
        blurY -= 10;
        blurFilter.blurX = blurX;
        blurFilter.blurY = blurY;
        // blur filter 
        //myVar.filters = filterArray; <---- Or I can have this but not both.......
        if (blurY<=0) {
            blurY=0;
            blurX=0;
            //delete (onEnterFrame);
        }
    };
}
function getDesaturationFilter(t:Number):BitmapFilter {
    t = t != undefined ? t : 1;
    var r = 0.212671;
    var g = 0.715160;
    var b = 0.072169;
    trace("colormatrixfilter called");
    return new ColorMatrixFilter([t*r+1-t, t*g, t*b, 0, 0, t*r, t*g+1-t, t*b, 0, 0, t*r, t*g, t*b+1-t, 0, 0, 0, 0, 0, 1, 0]);
}

[F8] Apply Filter To Mc Drawn With Api
Obvioulsy I'm blind.... WHY is't this code working...??!!!!!


Code:
import flash.filters.GlowFilter;
this.createEmptyMovieClip("mc_line",1);
with ("mc_line"){
lineStyle(20, 0xd1bca3,100);
_root.moveTo(0, 160);
_root.lineTo(Stage.width, 160);

// glow on the line
var glow:GlowFilter = new GlowFilter(0x003a68, 0.5, 0, 10, 5, 10,true);
var myTempFilters:Array = mc_line.filters;
myTempFilters.push(glow);
mc_line.filters = myTempFilters;
}



I've tried the glow-on-the-line part inside and outside the with statement.
The glow-on-the-line part works fine if I put an instance of a movie clip on the stage but not as above...

Why?!

I'd be greatful for a hint in the right direction...

How To Apply More Than One Filter Via Script...
Hi all...
Like the topic says...

How can I apply two filters (ie. Glow and Blur) via script on the same MC?

Thanks...

Apply Filter @ Runtime
hi everybody.


I've got 4 dynamic TextFields inside a MovieClip.
on onRollOver I want to apply a DropShadowFilter to this MovieClip, and on onRollOut I want to remove the DropShadowFilter.

pretty simple task, I hope
..how do I do it?


here's my onRollOver and onRollOut-code:

ActionScript Code:
allContainer_mc.textHolder10.onRollOver = function(){
    trace("onRollOver");
}
//
allContainer_mc.textHolder10.onRollOut = function(){
    trace("onRollOut");
}



thanks

Unable To Apply Any Actions To Buttons.
Hello,
I am trying to apply the geturl action to a button in Flash 5 that would allow me to link to a new url. The frame actions pallete will not allow me to drag and drop or double click on any of the actions. Even clicking in the parameters section of the pallete to type code will do nothing. I think I have covered the basics with making a new button symbol and applying key frames to each state of the button. Anything simple I may have overlooked?

Thanks!
cj

Apply Website Transition Filter?
Hey I'm new to AS , so I was wondering how would I go at attempting this?

On the website I'm building , I currently have it so when you click a link, it removes the current page and animates a new one, really simple, but how would I apply a filter transition? I downloaded a blur filter and installed it to flash cs3, so instead of just removing a page and motion tweening the new one, i would like to just do a motion blur tween between the current page, and the page clicked, how would I do that? This is my current code.



Should I upload the .fla file?

(EDIT) why wont it let me upload my code in CODE brackets? it gives me this error:

You have included 5 images in your message. You are limited to using 4 images so please go back and correct the problem and then continue again.

Change Color Then Apply Filter?
I have a simple circle movie clip in my library. The circle is green. I would like, at runtime, to change its color to blue, red, whatever. Then I want to apply a bevel filter to it.

The problem is that after I apply the color, the filter is ignored.

//First change color
var changeColor = new Color(mcCircle);
changeColor.setRGB(bitOnColor);

//Then apply filter
var innerBevel:BevelFilter = new flash.filters.BevelFilter();
var myFilters:Array = mcCircle.filters;
myFilters.push(innerBevel);
mcCircle.filters = myFilters;

Clearly I'm missing the point here. Anyone know the right way to do this? Thanks very much.

-jheske

Apply Text Filter Dynamically
How can I add a glow filter to a textfield via actionscript? I know the procedure for doing the same thing with a movieclip, but the TextField class (and TextFormat) don't seem to accept filters as a property?

What I have so far:


ActionScript Code:
import flash.filters.*;var text_glow:GlowFilter = new GlowFilter(0xFF0000, 80, 10, 10, 100, 3, false, false);var some_txt:TextField;//Want to apply filter to text field  

[AS3.0] Apply Filter To TextField Programmatically
Hi there!

I tried this using

Code:
textField.filters = [new GlowFilter()]
or just like in Flash8 passing the .filters array ref to another array and pushing filter to that array [was it?], but none of these steps worked.

Applying filter to Sprite, within which the TextField (_title) is contained:
Code:
var tit:Sprite = new Sprite();
tit.addChild(_title);
tit.filters = [new GlowFilter(0xFFFFFF,1,5,5,2,2)]
addChild(tit);
worked, however this method (using extra sprite for a textfield) is just too dirty, let alone we want to apply filters to multiple textfields..

Anyone knows how to apply filter directly to TextField instance in AS3.0?

Thanks!

Apply Filter To Just One Bitmap Data, No The Others?
Greetings,

I was following lee's tutorial on how to create advanced effects on bitmap data (like using the blur filter). I am not used to working with bitmap data and don't find it's creation and structure intuitive. Something I am not understanding is how to just blur a single clip and build the draw loop so that only that clips bitmap data gets drawn and blurred while other clips stay untouched. Any object I put onto the main timeline ends up bluring. I tried creative a sprite that contained the clip and then targeted that sprite, but still, any clip, or any object on the stage was blured and redrawn. Any help would be appreciated. Thanks!
Code:

import caurina.transitions.*;

var bmd:BitmapData = new BitmapData(550, 400, true, 0x000000);
var bm:Bitmap = new Bitmap(bmd);

var s:Sprite = new Sprite();
addChild(s);
s.addChild(bm);

var bf:BlurFilter = new BlurFilter(8, 8, 3);
var cmf: ColorMatrixFilter = new ColorMatrixFilter([1,0,0,0,0,
                                       0,1,0,0,0,
                                       0,0,1,0,0,
                                       0,0,0,1,0]);

var logo:Logo = new Logo();
s.addChild(logo);
logo.scaleX = logo.scaleY = .14;

function mover(){
   var myY:Number = Math.random()*stage.stageHeight;
   var myTrans:String
   myY <= logo.y ? myTrans = "easeOutExpo" : myTrans = "easeOutBounce";
   Tweener.addTween(logo,{x:Math.random()*stage.stageWidth,
                        y:myY, time: 1,
                        rotation:Math.random()*300, onComplete:mover,
                      transition:myTrans});
}


mover();

addEventListener(Event.ENTER_FRAME, loop);

function loop(e:Event):void{
   bmd.draw(s);
   bmd.applyFilter(bmd, bmd.rect, new Point(0,0), bf);
   bmd.applyFilter(bmd, bmd.rect, new Point(0,0), cmf);
   bmd.scroll(0, -5);
}

Apply Animated Filter To An Image
I'm at war with this code for a week now .. I managed to get ripple effect, but it doesn't apply to image positioned behind. So I need some directions on how to achieve that.
Right now the image is steel and doesn't move with the ripples. Any help is appritieted

The code itself is in 2 classes, first is Ripples.as
Code:

package
{
   import flash.display.Sprite;
   import flash.events.*;
   import RippleCanvas;
   public class Ripples extends Sprite {
      private var subobj:RippleCanvas;
      public function Ripples() {   
      trace("Ripples Initialized");
      var subobj = new RippleCanvas();
      this.addChild(subobj);

      }
   }
}


And second is RippleCanvas.as
Code:

package
{
  import flash.display.Bitmap;
  import flash.display.BitmapData;
  import flash.display.Sprite;      
  import flash.events.*;
  import flash.events.*;   
  import flash.geom.*;   
  import flash.filters.*;
  import flash.display.BlendMode;
   public class RippleCanvas extends Sprite
   {
      internal var sourceBmp:BitmapData;      
      internal var paintBmpData:BitmapData;
      internal var paintBmpData2:BitmapData;      
      private var buffer:BitmapData;      
      private var paintBmp:Bitmap;
      private var output:Bitmap;
      private var brush:Sprite;
      private var logo:Sprite;
      private var filter:BitmapFilter;
      private var filter2:BitmapFilter;
      private var disp:BitmapFilter;
      private var outputBmpData:BitmapData;
      private var surface:BitmapData;
      internal var pt = new Point(0,0);
      internal var matrix1 = new Matrix();
      public function RippleCanvas()
      {
         paintBmpData = new BitmapData(128, 98, false, 0x40);
         //new image(166,240);
         paintBmpData2 = new image(166,240);
         //new BitmapData(128, 98, false, 0x40);
         logo = new Sprite();
         brush = new Sprite();
         brush.graphics.beginFill(0xFFFFFF,1);
         brush.graphics.drawCircle(0,0,4);
         trace ("RIppleCanvas started..");
//         surface = new BitmapData(128, 98, true, 0x000000);         
         surface=new image(166,240);
         surface.blendMode = BlendMode.ADD;
         surface.draw(logo);
         sourceBmp=new image(166,240);
         sourceBmp.blendMode = BlendMode.ADD;
//             sourceBmp = new BitmapData(128, 98, false, 0x40);                              
         buffer = paintBmpData.clone();         
         outputBmpData = new BitmapData(128, 98, false, 0x40);
         //new image(166,240);
         scaleX = 8.0;
         scaleY = 8.0;
         this.addEventListener(MouseEvent.MOUSE_DOWN, this.downEvent, false, 0, true);                                             
         this.addEventListener(MouseEvent.MOUSE_UP, this.upEvent, false, 0, true);   
         this.addEventListener(Event.ENTER_FRAME, this.update, false, 0, true);         
         paintBmp = new Bitmap(paintBmpData);
         var cmat:Array = [ 1, 1, 1,1, 1, 1, 1, 1, 1 ] ;
         filter = new ConvolutionFilter(3, 3, cmat, 9, 0);
         filter2 = new BlurFilter(4,4);
         output = new Bitmap(outputBmpData);
//         output.blendMode = BlendMode.ADD;               
//         paintBmp.blendMode = BlendMode.ADD;
         addChild(output);         
         addChild(paintBmp);
         //var tf = new TextField();
         //tf.text = "testing123";
         //addChild(tf);
      disp = new DisplacementMapFilter(paintBmpData2, new Point(), 4, 4, 48, 48, DisplacementMapFilterMode.IGNORE );
      this.filters = new Array(new BlurFilter(16, 16));
         this.blendMode = BlendMode.ADD;
      }
      function update(e:Event)
      {
         if(parent!=null){
               var localPt:Point = parent.globalToLocal(new Point(parent.mouseX*0.125, parent.mouseY*0.125));                              
               var m:Matrix = new Matrix();
               m.translate(localPt.x, localPt.y);
               sourceBmp.draw(brush, m, null, 'invert');
            }
         trace (localPt);
         paintBmpData.applyFilter(sourceBmp, paintBmpData.rect, pt, filter);
         paintBmpData.draw(paintBmpData, matrix1, null, 'add');
         paintBmpData.draw(buffer, matrix1, null, 'difference');         
         paintBmpData.draw(paintBmpData, matrix1, new ColorTransform(0, 0, 0.98609374, 1, 0, 0, 2, 0));         
         paintBmpData2.draw(paintBmpData, matrix1);
         outputBmpData.applyFilter(surface, outputBmpData.rect, pt, disp);
         buffer = sourceBmp;
         sourceBmp = paintBmpData.clone();
      }
      public function downEvent(e:Event)
      {      
         if(e.stageX == 0 && e.stageY == 0)
            return;
         var curPt:Point = parent.globalToLocal(new Point(e.stageX, e.stageY));
         e.stopPropagation();
      }
      public function upEvent(e:Event)
      {
         e.stopPropagation();            
      }
   }
}


Code itself is in a mess right now as I tryed every single combination, without any success.. so plz help

Blur Filter
Hey everyone,
I am trying to get my file so that when I click a button named "button 2" the instance named "big" gets a blur filter, slides to the right 100 pixels, and then the blur filter turns off....... Can anyone PLEASE help? I've been trying to do it all night... Thanks in advanced!


-Joe

Blur Filter
Hi,

i am trying to use the blur filter.. myMc is blurred fine untill i load a new swf into it, than the blur filter is removed.. is there any way to avoid this?


PHP Code:



  import flash.filters.BlurFilter;
var filterArray:Array = new Array();
var filter:BlurFilter = new BlurFilter(100, 100, 2);
filterArray[0] = filter;
myMC.filters = filterArray;




many thanks,
Gareth

Blur Filter.....
I came across a web site and am wondering how they blurred the whole screen. I have Flash 8 and I can blur each MC but I don't know how to do a full blur effect that covers all images, text, mc's, and layers of the Flash file. Any help?

www.firstbornmultimedia.com and the effect I am referring to is in the portfolio section then click on a thumbnail and then click to see the project and the portfolio is screened and blurred out of focus.

Thanks for the help!!!!

Blur Filter Help
I am trying to apply a blur to a movie clip and 'unblur' it on a RollOver of the macro_btn, It is blurred at first but doesnt unblur.

Im not sure what's wrong with my code:


Code:
import flash.filters.BlurFilter;
var blurred:BlurFilter = new BlurFilter(5, 5, 4);
var storedBlur:Array = [blurred];
bug_mc1.filters = bug_mc2.filters = storedBlur;
macro_btn.onRollOver = function() {
_root.bug_mc1.filters = null;
}
macro_btn.onRollOut = function() {
bug_mc1.filters = storedBlur;
}
any ideas?

many thanks

Blur Filter Help
Hi,

I want to put on a blur filter using actionscript.

Here is the code i used


Code:
//BLUR FILTER
var windowBlur = new flash.filters.BlurFilter();
window_mc.filters = windowBlur

var myTempFilters = window_mc.filters;
myTempFilters.push(windowBlur);
window_mc.filters = myTempFilters;

windowBlur.blurX = 50;
windowBlur.blurY = 50;
does anyone know why this is not working?

thanks

dan

Blur Filter
Hi,

i am trying to use the blur filter.. myMc is blurred fine untill i load a new swf into it, than the blur filter is removed.. is there any way to avoid this?


PHP Code:



  import flash.filters.BlurFilter; var filterArray:Array = new Array(); var filter:BlurFilter = new BlurFilter(100, 100, 2); filterArray[0] = filter; myMC.filters = filterArray; 




many thanks,
Gareth

Blur Filter
Im trying to target a specific item in the array. It traces but I cant seem to target it. I want to make a function that will loop through the array and blur each item after a set period of time, but I am stuck on the first part. Here is the problem line "this.filters = filterArray[2];" Thanks


ActionScript Code:
import flash.filters.BlurFilter;
var blurFilter:BlurFilter = new BlurFilter(0, 0, 3);
var filterArray:Array = new Array("more", "than", "75", "las", "vegas", "shows");
//var filterArray:Array = new Array();
filterArray.push(blurFilter);
var blurX:Number = 0;
var blurY:Number = 200;
this.onEnterFrame = function() {
    //var blurX:Number = this._xmouse / 10;
    //var blurY:Number = this._ymouse / 10;
    //blurX -= 10;
    blurY -= 10;
    blurFilter.blurX = blurX;
    blurFilter.blurY = blurY;
    this.filters = filterArray[2];
    trace(filterArray[2]);
    //trace("looping");
    if (blurY<=0) {
        delete (this.onEnterFrame);
        //trace("delete");
    }
};
stop();

[CS3] Apply Blur To A Spotlight Mask?
Alright, I give up. I know this is something stupid, but I can't figure it out for the life of me. I'm trying to create a blurred mask, and everything's working but the blur.

"bglayer" is the layer that gets exposed, "toplayer" is the layer that the mask acts on. I'm drawing the mask itself as "lightSpot" and that's what I need to blur.

Can anyone tell me in what way I'm being an idiot? TIA. Here's my code:

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

import flash.display.Sprite;
import flash.filters.BitmapFilterQuality;
import flash.filters.BlurFilter;

var lightSpot:Sprite = new Sprite();
toplayer.addChild(lightSpot);

bglayer.mask=lightSpot;
bglayer.mouseEnabled=false;

var isOver:Boolean=false;
var spotSize:Number=0;

var blur:BlurFilter = new BlurFilter();
blur.blurX = 75;
blur.blurY = 75;
blur.quality = BitmapFilterQuality.HIGH;

function drawSpot(r:Number,blur:BlurFilter):void {
lightSpot.graphics.clear();
lightSpot.graphics.lineStyle(1,0x000000);
lightSpot.graphics.beginFill(0x0000FF);
lightSpot.graphics.drawCircle(0,0,r);
lightSpot.graphics.endFill();
lightSpot.filters = [blur];
spotSize=r;
lightSpot.startDrag(true);
}



toplayer.addEventListener(MouseEvent.ROLL_OVER, whenOver);

function whenOver(e:MouseEvent):void {
isOver=true;
}

toplayer.addEventListener(MouseEvent.ROLL_OUT, whenOut);

function whenOut(e:MouseEvent):void {
isOver=false;
}



stage.addEventListener(Event.ENTER_FRAME, whenEnterFrame);

function whenEnterFrame(e:Event):void {
if(isOver){
drawSpot(175,blur);
}
if(!isOver){
drawSpot(0,blur);
}
}


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

How To Clear The Blur Filter?
I am using the following code to blur a movieclip

function blurMe(blurX, blurY) {
import flash.filters.BlurFilter;
quality = 1;
filter = new BlurFilter(blurX, blurY, quality);
filterArray = new Array();
filterArray.push(filter);
this.filters = filterArray;
if (blurX == 0) {
if (blurY == 0) {
filterArray = [];
this.cacheAsBitmap = false;
}
}
}

itWorks great, but I can't seem to get the blur to turn off completely. If I set the blurX&Y to 0 the Help DOCs say it will not apply a blur filter, but while there is not visual blur, I am still experiencing the FPS hit as if the movie clip where blurred.

The Help DOCs also frequently reference "clearing" the filter. I assume that means assigning it to an empty array as I have tried here, but the FPS hit is still there.

Anyone know how to clear it and get back my FPS after using the blur?

Blur Filter Slow
Is there a reason why the blurfilter is so slow? I set the quality at 3 and also tried one, but it slows down my animations. I've also tried TweenFilterLite as well, and it's also slow as well.

Help With The Blur Filter Using Fuse
When using the,

mc.Blur_blurTo (100);

The quality of the blur is default to the lowest. How would I change the quality?

IF Function And Blur Filter
Hi,

I want to be able to alter the blur of a movie clip with a slider.

Here is the code i have used:

Code:
//
// Make a new blur filter.
var windowBlur = new flash.filters.BlurFilter();
// Create an array;
myTempFilters = [];
// Put the filter in an array.
myTempFilters.push(windowBlur);
// Assign the array to the "filters" property of your movieclip.
window_mc.filters = myTempFilters;
//
//

onEnterFrame = function () {
//trace(_root.sliderPosition);
_root.sliderPosition = _root.mySlider._y;
if (_root.sliderPosition>146 && _root.sliderPosition<166) {
myClip.gotoAndStop('first');
// Set the filter's properties.
windowBlur.blurX = 0;
windowBlur.blurY = 0;

}
if (_root.sliderPosition>166 && _root.sliderPosition<186) {
myClip.gotoAndStop('second');
// Set the filter's properties.
windowBlur.blurX = 50;
windowBlur.blurY = 50;

}
if (_root.sliderPosition>186 && _root.sliderPosition<206) {
myClip.gotoAndStop('third');
}
Does anyone know what i have to do to change the blur with the slider?

Thanks
__________________
Dan

Animate Blur Filter?
I have some images that I want to fade in and blur in at the same time, then fade/blur out.

I can do the fade easily....but what's the best way to animate a blur filter in AS?

Thanks.

Blur Filter Confusion
Hi i have a single transparent (per pixal transperency) png imported to the stage . Id like to add some blur behind the png without bluring my sharp png much like vista's aero glass.

I have tried creating a movieclip with a single white shape and applied a blur filter to that which gives me the effect i want of the background blured behind the png but with a white tint as i decrese the alpha value and at 0 my blur filter disapers aswell .

Does anyone know of a solution without applying the blur filter to my transparnt png ?

Blur Filter Slow
Is there a reason why the blurfilter is so slow? I set the quality at 3 and also tried one, but it slows down my animations. I've also tried TweenFilterLite as well, and it's also slow as well.

Blur Filter Problem
hi
i have a question about blur filter.
when i remove blur filter from my sceneContainer, small texts which is in my sceneContainer are seem bad. like there is no anti aliasing. i tried to remove text movieclip and added new text clip to sceneContainer again result is same. it seems like to me there is still blur filter on container but i can't trace it on control panel when i write

trace(sceneContainer.filters.blurFilter2.blurX);

it says
TypeError: Error #1010 A term is undefined and has no properties.

here is the simplified code i use it for adding and removing blurfilter

if (blurFilter2.blurX == 0) {

blurFilter2.blurX = 7;
blurFilter2.blurY = 7;
}

if (blurFilter2.blurX == 7) {

blurFilter2.blurX = 0;
blurFilter2.blurY = 0;
}

sceneContainer.filters = [blurFilter2];

do you have any idea
see you

AS 3.0 - Animate Blur Filter...
I've looked for a few days and I can't find out how to animate a blur filter with actionscript. I have a box on the stage that I'm tweening and I just want to add motion blur to it. I'm trying to use the MOTION_CHANGE listener but no luck yet. Thanks!

[F8] How To Add The Blur Filter To This AS Animation?
How can i add the blur filter to this animation, acording to the speed of it?

Thanks

Blur Filter Problem ... :(
I have this script and I can't figure out why it works when I have 7 pictures to scroll between but when I have 12 images it doesn't work ...

Any ideas?

Thanks!

Boon.


Code:

// Motion Blur slider
//
stop();
import flash.filters.BlurFilter;
//
// Variables
//
var speed:Number = 1.8;
var numButtons:Number = 12;
var blFilter:BlurFilter = new BlurFilter(0, 0, 2);
var imgDist:Number = 305;
//
// Functions
//
function initButtons():Void {
for (var i = 0; i<numButtons; i++) {
var btn:MovieClip = this["b"+i];
btn.targetx = -(i*imgDist);
btn.onRelease = function() {
blurTo(slider_mc.images_mc, this.targetx);
};
}
}
function blurTo(mc:MovieClip, tx:Number):Void {
// common ease equation
mc.onEnterFrame = function() {
var dx:Number = tx-this._x;
var blurAmount:Number = Math.abs(dx);
blFilter.blurX = blurAmount;
this.filters = [blFilter];
var movex:Number = dx/speed;
this._x += movex;
if (Math.abs(this._x-tx)<1) {
delete this.onEnterFrame;
this.filters = null;
this._x = tx;
}
};
}
//
// Begin
//
initButtons();
Here is the .fla

Blur Filter & Tweening
for some reason i can't seem to get my head around how to do this.

basically i want to tween in a movieclip (flies in vertically) and as it tweens in i want it to blur and as the tween class tween ends, i want the blur to fade out. Maybe as the tween reaches it's halfway point the blur could decrease so it comes to a nice natural stop.

i've been over the tutes and can't seem to get a grip on it...

here's my (NEW) code (not anywhere close at this point):


Code:
startMain=function(){


var t1:Tween = new Tween(tallClip, "_y", Bounce.easeOut, startPos, targetPos, 3, true);
var t2:Tween = new Tween(tallClip, "_alpha", None.easeNone, 0, 100, .25, true);

t1.onMotionChanged=function(){
trace("duration: "+this.duration);
trace(this.time);
var blurAm:Number = ((this.duration - this.time)*10)/2;
trace("BLURAM: "+blurAm);

var myBlur = new flash.filters.BlurFilter();
var myBlur:BlurFilter = new BlurFilter(0, blurAm, 3);
var myTempFilters:Array = new Array();
myTempFilters.push(myBlur);
_root.tallClip.filters = myTempFilters;

}



}


startMain(startPos, targetPos);

at this point i can't seem to even get the blur applied to my clip properly...

ggrrr!!!

Blur Filter Issue
hi there kirupa's!

well, i'm wondering about the blur filter...
i'm building a cd-rom aplication and i'm using a blur filter in a movieclip reflection, but when i publish my work, the blur is not set!

i have other areas where the blurs work, and i'm wondering if it could be caused by the really huge size of the movieclip (about 3500 width). could the movieclip's size be the problem?

i'm also using the setMask to create a alpha gradient, that dont work either.

anyone had ever experienced any problem like this? its just this movieclip, so i'm starting to think its due to the clip's size...


thanks in advance!
and keep up the good work!

Applying A Blur Filter?
The code below fades three mc instances into each other.  The movieclip instances are called, picture1_mc, picture2_mc,
picture3_mc. They are based on three bitmap images that also sit in the library.  I manually converted the original
 bitmaps into movieclips on the stage area.  The fade code works fine, but what I would like to do is allow the user to
mouse click and cause a blur effect whilst the images are cycling along.  My problem is that Im not sure how to apply
this within my mousedown function.  The applyFilter method seems to call for bitmaps but I'm dealing with movieclips.
Thanks for any guidance
import flash.display.BitmapData;
import flash.geom.Point;
import flash.geom.Rectangle;
import flash.filters.BlurFilter;
var filter2:BlurFilter = new BlurFilter(Math.ceil(Math.random()*5), Math.ceil(Math.random()*5), 3);

init = function () {
    currentIndex = 1;
    currentLayer = 1;
    howLongToWait = 0;
    _root.attachMovie("picture1_mc", "pic1", 0);
    addNewPic();
};
addNewPic = function () {
    clearInterval(myInterval);
    if (currentIndex%3 != 0) {
        currentIndex++;
    } else {
        currentIndex = 1;
    }
    newlyAdded_mc = _root.attachMovie("picture"+currentIndex+"_mc", "pic"+currentIndex, currentLayer++);
    newlyAdded_mc._alpha = 0;
    newlyAdded_mc.onEnterFrame = function() {
        this._alpha += 2;
        if (this._alpha>=100) {
            this.onEnterFrame = null;
            myInterval = setInterval(addNewPic, howLongToWait*100);
        }
    };
};
// run init()
init();
onMouseDown = function ()
{
    //problems here!!!!!!!!!
    var point:Point = new Point(_root._xmouse, _root._ymouse);
    var rec:Rectange = new Rectangle(100,100,6,6);
    //problem applying filter
    //????.applyFilter(?????,rect,point,filter2)
};
myListener = new Object();
Mouse.addListener(myListener);

Blur Filter Limits ?
I came across a great site that has a blur effect when scrolling. I've managed to apply it to a site that i was building and it worked great, BUT, in this site i've built a XML dynamic gallery that loads Jpegs externally and at a certain point the blur filter applied to this gallery stops.... :shock: . i the went to the help docs to find out why...
It seems that the flash 8 filters won't apply themselves to objects bigger than 2880 pixels. Witch is a problem for a dynamic gallery. By the 7th photo the filter stops working.

I've created the gallery this way:

Create empty MC named "main"
attach a previously created MC w/ a linkage ID "item_mc".
In this "item_mc" i have a empty MC named "loader" and 2 dyn. textfields
Then i load the xml and load the photos into "loader"

thus, i have _level0.main.item_mc+(number).loader

I apply the filter to "main" for when i scroll the gallery i obtain a nice blur effect. But as you can imagine the gallery increses size rapidly and when it reaches 2880 pixels the filter stops.

I would post the fla but a work ethics clause in my contract prevents me to do that.

Does any 1 know a way to go around this?

I've tried to apply the filter to each "item_mc" but that is too processor intensive (68 pictures :shock: )

cheers...

'flatten' Blur Filter? (to Bitmap)
Hello, is there a way to render a movie clip to a bitmap once a filter is applied, to the Same movie clip?

i have a clip on stage, a blurfilter is applied:

treeHolder.tree.filters = [bf];

i want to simply apply the blurfilter, then as soon as it is applied, just flatten the image, or convert that MC to a bitmap.

i have been playing around w/ a senecular code that copies a bitmap representation from one movie clip to another, but i want the blurred bitmap to just replace the current vector mc.

thanks for any help.
q

Tweener Blur Filter Not Working
Im having difficulty geting the blur filter to work with Tweener.. i get the message -

##[Tweener] Error: The property '_filter' doesn't seem to be a normal object property of [object Object] or a registered special property.

The example code i am trying to get working is the following -

import caurina.transitions.Tweener;
// Adding a new filter: creates a BlurFilter on the object
import flash.filters.BlurFilter;
var myBlur:BlurFilter = new BlurFilter(10, 10, 2);
Tweener.addTween(myMC, {_filter:myBlur, time:1, transition:"linear"});


What am i missing?

Blur Filter And Motion Tweens
I am creating an animation in which about 5 movie clips that have blur filters move across the screen. One movie clip starts with a gradient blur filter, and moves up the screen while the blur disappears. This movie clip seems to slow down everything completely.

Is there any way to speed this up a bit?

SetMask On Clip With Blur Filter
i ve a movie clip called main on root timeline...Inside main, i create a shape with dimensions 550 x 400 to fill the entire stage. Above this shape on a new layer i placed a move clip called star (inside star there is a star shape that scales up and down using shape tweening).Moving back to the root timeline i have applied blur filter to the main movieclip .Now above the movie clip main i placed another movie clip called box with dimensions 550 x 400...Now i m using the following code on the root timeline

main.setMask(box)

the problem is that when the star movieclip scales up and down it form a trail of its bounding box... how can i solve this problem

thnx in advance..

Tween A Blur Filter's Value Using Tweener
I have some code which i believe should tween a blur filter's value over time but it isnt working :(

any fixes would be greatly appreciated, below is all the code related to the filters and tweener functions







Attach Code

function removeThing(e:MouseEvent):void
{
var clip:MovieClip = e.target as MovieClip;


var bf:BlurFilter = new BlurFilter(0, 0, 3);
var filtersArray:Array = new Array();
filtersArray.push(bf);


clip.filters = filtersArray;

var scaleBig:Number = 3;
Tweener.addTween(bf, {blurX:100, blurY:100, time:5});
Tweener.addTween(clip, {scaleX:0, scaleY:0, time:5, transition:'linear', rotation:720, y:mouseY, x:mouseX});
bf.blurX = bf.blurY = 10;
}

























Edited: 06/03/2008 at 12:07:57 PM by UberShinySheep

Blur Filter According To Mouse Speed [F8]
Hello,

I´ve done a 3d object to rotate according to the position of the mouse while holding.
I´d like to add a blur effect to the MC while moving the mouse. So when the mouse is moving fast, the blur on the MC would 10, and if the mouse stoped, the blur would be 0.

is it possible?
thanks

Applying Blur Filter Using MASK
Is it possible to apply the filter blur to a masked area? if so, how?

Thanks

Blur Filter In Class File
I am using
ActionScript Code:
var blurFilter:Array = this_mc.filters;blurFilter[0].blurX = 10;this_mc.filters = blurFilter;
to induce a 10px blur on my MC. It works when the code is placed right on the timeline of the MC in question.

However when i use the exact same code in an external "effects" class file, it does not work.

Should i be looking at refferencing problems? Scoping problems? What gives?

Problem With Loadmovie And Filter Blur
Hi,
I have a problem while load an external movie (with blur effect applied with flash 8 and as 2.0) in a swf (flash 8,as 2.0) with loadMovie....

Any solution?
Thanks a lot...

Animating Blur Filter With Actionscript
Hey guys,

I've been scouring the internet for the past hour or so in search of how to do this. It's very simple, but every example seem to want me to bring a loaded movie clip, or trace mouse position. I don't need that!

Basically I have a button that when clicked comes to the front (using behaviours), moves to a new position, scales and then I want every other button behind it to blur. Obviously I want them to blur gradually to keep the flow going.

Here's my current code so you can see where its going:

on (release) {

import mx.transitions.easing.*;
import mx.transitions.Tween;
import flash.filters.BlurFilter;

//Bring to Front Behavior
mx.behaviors.DepthControl.bringToFront(_root.testi monials_content.testimonial1);
//End Behavior

//gets rid of buttons
gotoAndPlay("no_buttons");

//brings to centre
var testimonialX:Tween = new Tween(testimonial1, "_x", mx.transitions.easing.Back.easeOut, -377, 0, 10, false);

testimonialX.onMotionFinished = function() {

//scaling
var testimonialH:Tween = new Tween(testimonial1, "_height", mx.transitions.easing.Bounce.easeOut, 134, 333, 10, false);
var testimonialW:Tween = new Tween(testimonial1, "_width", mx.transitions.easing.Bounce.easeOut, 146, 363, 10, false);

//blurs other testimonials

}
}

All the instances are already on the stage so I don't want to go calling anything else in.

So how do I simply say I want testimonial to blur over 5 frames or so?


Cheers!

Copyright © 2005-08 www.BigResource.com, All rights reserved