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




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.



ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 06-07-2006, 09:33 AM


View Complete Forum Thread with Replies

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

[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

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  

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 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 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);

[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

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?

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);

Implementing Filter Class For Bitmapdata
Hi all. I am trying to experiment with the bitmapdata class for a project I am working on. I need to twirl one image into another. I found this class at: http://code.google.com/p/as3filters/source/browse/trunk/src/as3/Filter.as?r=3

I am just learning about class packages and would appreciate any help on getting these filters to run properly on an image in my flash movie. I don't understand how to specify which image or movieclip gets the filter applied, and how to correctly install this class.

Thanks,

[ Noisy Bubbles ] ...a BitmapData Filter.orgy
Currently I´m working meticulously on this 3d bubbly-system. It imply that it´s going to be a massive use of all kind of bitmapData-filters.



But I think the current result is very nice already, also this experiment is just a single extract of the whole bubble system I´m working on at the moment.

Enjoy.


launch

[ Noisy Bubbles ] ...a BitmapData Filter.orgy
Currently I´m working meticulously on this 3d bubble-system. It imply that it´s going to be a massive use of all kind of bitmapData-filters.



But I think the current result is very nice already, also this experiment is just a single extract of the whole bubble system I´m working on at the moment.

Enjoy.


Launch!

[noisy Bubbles] ...a BitmapData Filter.orgy
Currently I´m working meticulously on this 3d bubbly-system. It imply that it´s going to be a massive use of all kind of bitmapData-filters.




But I think the current result is very nice already, also this experiment is just a single extract of the whole bubble system I´m working on at the moment.

Enjoy.

launch

[noisy Bubbles] ...a BitmapData Filter.orgy
Currently I´m working meticulously on this 3d bubbly-system. It imply that it´s going to be a massive use of all kind of bitmapData-filters.



But I think the current result is very nice already, also this experiment is just a single extract of the whole bubble system I´m working on at the moment.

Enjoy.

>> Launch.

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]);
}

Bitmapdata + ColorTransform / Blend Mode / Filter Problem
I'm making a worms / leiro type game..

And I'm trying to make the ground change color around the "explosions" so it looks like the ground is burnt.

this is what i have so far:


Code:
public function blastCircle(x:int,y:int,r:uint):void{
//make temp circle to cut hole
var c:Sprite = new Sprite();

c.graphics.beginFill(0x000000);
c.graphics.drawCircle(x, y, r+1);
c.graphics.endFill();
//make a black circle that only affects opaque pixels
draw(c, null, new ColorTransform(1,1,1,0.5,0,0,0,0));

c.graphics.clear();
c.graphics.beginFill(0xFFFFFF);
c.graphics.drawCircle(x, y, r);
c.graphics.endFill();
draw(c, null, null, "erase");

//resetPalette();

}
You can see what i've got so far (without the black ring code).

I cant seem to find the correct blend mode or color transformation etc to make it affect only opaque pixels. so i end up with the burnt area also affecting the "air".

Apply Glow Filter On Target MC While Dragging An Object And Rolling Over The Target
I can get my filter to apply to a movie clip if i simply rollover or roll out of it. When the mouse rolls out, the filter is set to undefined. The problem I am having is that I want the object that is in effect the hit area to glow (have a filter applied) when the draggable object is being dragged over it.

This would make is easier for the user to visually identify that where they are currently hovering over, whilst dragging, is the area that they should drop the object.

Part of my code looks like this


Code:
this.onRollOver = function () {
if(_global.isDragging == 1){
this.filters = glowFilterArray;
}
}



this.onRollOut = function () {
_global.isDragging = 0;
this.filters = undefined;
}
_global.isDragging is set to 1 at the onPress stage, when startDrag occurs.
_global.isDraggin is set to 0 onRelease of the draggable object.

Are there any ideas for a solution?

Invert Colors/channel Of A BitmapData Object
What's quick way to invert the colors of a BitmapData channel. (eg. I want to invert the alpha channel (eg. a pixel that is 200 in alpha channel becomes 55...).

The reason is i'm copying this grayscale Perlinnoise smoke image and makig it such that the darker the color, the more transparent it is. (I'm using copyChannel.RED/GREEN/BLUE->CopyChannel.ALPHA). But right now, it's the other way round at the moment (ie. the brighter the pixel, the more opaque it is.). I want it to be more transparent instead (inversely proportional), so if i could find simple & fast way invert the alpha channel, it would do me so much more good. (I need a fast method...performance is critical!)

Filter
How to make a filter, do I have to draw it, or maybe there is special Action Script.

Hue Filter And AS?
Hi guys,

I'm trying to get to grips with adjusting filters on the fly with actionscript. However I am simply lost..... Specifically I am trying to adjust the hue of a movieclip called box_mc which is on the root of the movie. I have no idea how to do this, and the help in flash has further confused me even more.

Despite my embarassment I am asking for any useful tips or advice.

Any help would be appreciated,

Steven.

XML Filter
I have a photogallery that initially loads all of my images with thumbnails. What I want is to have a checkbox next to my thumbnails that filter out certain images as well as their thumbnails. I'm not sure how to do this.

Do I have to reload the XML and with the function loading each thumbnail or is there a way to do this that simply hides/shows those images and thumbnails? I'm guessing that I have rerun through the xml so that my thumbnails are evenly spaced apart. What's the fastest way to go through the images and filter out the ones I don't want to show?

Help Kirupa!

Filter
Hi

I want to dynamicaly change the filters

For example imagine we have a picture and we want to blur it or drop shadow and etc... BUT not in our work space... I want to have a dynamic one and change the filters in my swf file.something like scrolling and changing the filters from our swf file.


Please help me


Best regards
Ali

Filter?
how can i do this:

I have 2 text boxes, original and filtered.

original is an input text box and when u type for example "what the hell" in it, and u want "hell" to be filtered,, it will come up as "what the bleep" in the filtered text box...?

thanks.

[AS3] Filter Bug
I have just run into a bug when using filters in AS3. I'm not sure if this is just related to the DropShadowFilter class or not but you can see it here. Drag 'n' drop the blocks and you will see that the drop shadow isn't cleared from the screen until the bounding box of another display object is moved over it.

I was just adding some extra 'spice' to my drag manager class when I ran into the problem. What the drag manager does is remove a component from it's original display list and add it to the stage, this allows the component to be freely dragged around from display list to display list.

However, it seems that Flash is getting confused when a display object is moved from one display list to another. Does anyone else know about this problem, or does anyone know how to 'fix' it?

Use Bitmapdata To Copy Flv W/ Alpha Channel And Make Dropshadow
I am trying to copy an flv w/ alpha channel but it keeps coming in with a white background. This is my code can anyone help me out?

Thanks!




PHP Code:



import flash.display.BitmapData;
import flash.geom.Matrix;
import flash.geom.Rectangle;
import flash.geom.Point;

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.play("../flvs/1a.flv");
v.attachVideo(ns);

var bmpVideoCopy:BitmapData;
var bmpA:BitmapData;
var mA:MovieClip = mA;

mA._x = v._x;
mA._y = v._y+v._height/2;

setInterval(update, 80);

function update():Void {
  bmpVideoCopy = new BitmapData(v._width, v._height);
  bmpVideoCopy.draw(v, new Matrix());
  bmpA.dispose();
  bmpA = new BitmapData(bmpVideoCopy.width, bmpVideoCopy.height/2);
  bmpA.copyPixels(bmpVideoCopy, new Rectangle(0,  bmpVideoCopy.height / 2, bmpVideoCopy.width, bmpVideoCopy.height), new Point(0, 0));
  mA.attachBitmap(bmpA, mA.getNextHighestDepth());


Language Filter
Hi actionscript gurus... I'm lost again.
Pretty easy I hope. How can you (and is it possible to) filter an input text form in flash.
I currently have something like this:


Code:
} else if (comment eq "***" or comment eq "***" or comment... etc...){
status = "Please no - bad words !";
But this only seems to work if I type "***" in the text field, and only "***". So if I type "you're such a ***" It won't recognise it.
I there a way to make it search the whole text field for a certain word?
Thanks,
-Laz-

Greyscale Filter
Does anyone know a way of using the advacned color settings to make symbols appear greyscale...

Thanks

Gareth

Photoshop Filter
anyone knows this photoshop filter name in english "gerissene kante"?

Flash IP Filter
Hello
i am trying fo make an IP filter but i have bumped into some difficulties

at my movie at the first frame i have code loadVariablesNum("ip.php",1);
_level1.onData=function(){
gotoAndPlay(this.myvar);
}

and at my ip.php

<?php
$CheckIP = $_SERVER["REMOTE_ADDR"];

if ($CheckIP =='217.11.238.194') { $myvar="3"; }
else{ $myvar="500"; }

?>

but unfortunatlz i have some mistakes here so this system does't work i need some help on this one
Any advices are welcome

Thanks!

Filter Effects
Any help would be very, very welcome,

I'm a bit new to this fangled flash thingy. My background is PhotoShop and photography, video and still.

I've notice in flash there are some that apply "shimmer" and "ripple" effects to photos..

How is this done, it looks like a photoshop plugin, but then exported to flash...

Can anyone shed some light on this?

Thanks......

Filter Funk
I'm trying to filter a v2 dataset with the following function:
Code:
function selectCoverage( option:String ):Void {
trace( "Coverage option selected: " + option );
xmlDataSet.filtered = false;
if( dataFilter == option ) {
dataFilter = "";
} else {
xmlDataSet.filtered = true;
xmlDataSet.filterFunc = function( item:Object ) {
trace( item.coverage.attributes.type == option );
return( item.coverage.attributes.type == option );
}
dataFilter = option;
}
ListBox.refreshFromSources();
}
The idea is that the user clicks on one of three buttons, and the data is than filtered to show only the fields with a particular attribute set to that value (passed to the function as the variable "option"). A listbox (called, imaginatively enough, "ListBox") is then refreshed with the name of each record. Both the dataset and the list are sorted alphabetically.

That's the theory, anyway. What actually happens is that all the records remain visible, but the sorting in the list gets toggled on and off each time you press one of the three buttons. I know the function is returning the trues and falses correctly, because I had trace statements in there to test it.

If anyone has any thoughts on this, it would be very helpful.

Rys

Filter Transitions
Hello, can anyone give me a code example of transitioning the filters? is there a way to work with the filters using transition codes similar to the mx.transitions of mx 2004? it would be great if you could give a start value and end value for the parimeters of the filters such as blur/glow, and a time value. if there is examples of this, please post here! thanks.
quentin

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

PLEASE HELP Trying To Filter XML List Box?
I am using Flash MX Pro 2004 and I am trying to populate a list box with XML data using the standard XMLConnector etc - of which I am having

no problems.

The problem I'm having is trying to filter this data. It's driving me round the bend. I've tried all the "use path expression" variations i can think of still

with no joy.

I have attached a sample "trips" application which I built from a tutorial. It is not the application that i'm working on but the principles are exactly the same (i.e need to filter an XML list box).

In the sample that I have attached I would like to filter the Trip list box to only contain the trips where the travel xml field = "boat".

Anyone have any Ideas I'm really struggling?

I had to rar then zip the file because the max size is 300Kb and winzip only managed 450Kb and rar was an invalid file upload format.

Or there is a link here..XMLFilterHelp.zip

Thanks in advance people!

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

Filter Button
Got a list of MCs being populated from an XML file. Basically a list of two different types of information. Some are type A, some are type B.

Want to have a couple buttons that filter based on type (so if I push the button for type A (called "typeAbtn" below), only those MCs appear, type B MCs go to _alpha = 0 or something).

Can't seem to come up with a function to do it.

terrible attempt:

Code:
function showMCs() {
for (var j = 0; j<stuff.length; j++) {
MC = timeline_mc["MC"+j];
MC.type = xml.blahblah.attribute.type;
...

typeAbtn.onPress = function() {
if ( MC.type == "B" ) {
MC[?].alpha = 0;
}
}

Easing On A Filter
playing with filters today...i totaly get the concept, adding, removing, different kinds, etc. However, can i get a lead on how to gradually add a filter? I.E> click a button, and a filter will easeOut/easeIn (depending)....right now, i can't think outside of the "instant on/off" process! I came up with this, but i am sure how to add in the ease...

Code:
import flash.filters.BlurFilter;
var afFilter:Array = [];
var xO = 0;
var y0 = 0;
function addBlur(targetBlur) {
xO++;
yO++;
var blr:BlurFilter = new BlurFilter(xO, yO, 2);
afFilter.push(blr);
mc.filters = afFilter;
if (xO>=targetBlur) {
clearInterval(nBlur);
}
updateAfterEvent();
}
nBlur = setInterval(addBlur, 15, 14);

[F8] Filter Dataset (XML)
I'm trying te load tour-dates from an XML-file into Flash using XMLConnector and a DataSet. So far...no problems. Now I want to filter out all dates prior to the current date. A Zip-file with the currnet .fla and .xml is included.

Any suggestions?

[F8] Glow Filter Help
Hi,
I have an earth glowing this is the action script i used to do that...

Code:
var Glow:Number=150

import flash.filters.GlowFilter;
color=0x0066FF;
alpha=20;
blur_X=Glow;
blur_Y=Glow;
s=2;
q=2;
ig=false;
k=false;

var filter:GlowFilter = new GlowFilter(color,alpha,blur_X,blur_Y,s,q,ig,k);
var filterss:Array = new Array();
filterss.push(filter);
r.filters = filterss;
So with the glow i want it so that if the user presses a button it decreases the blur_X and blur_Y value, so i have used a variable called glow.

Now what i have on a button is

Code:
on (release) {
Glow-=100
}
To test wether the value is decreasing i have used a dynamic text box (and it is going down) but the problem is that the glow still remains the same

How do i make it so that when the button is pressed the glow decreases, does it need to loop the frame somehow so it reloads the script?

Filter Vs Texture
I'm trying to add some effects to some text to spas the text up. I have 3 different effects that I want put on. 2 of them are flash filters and the other one is a texture. I'm using the perlinNoise function to create the texture and then I'm using a mask to apply it. My problem is when I try to apply the mask to add the texture, the filters disappear and the only thing that is remaining is the texture.
With filters: http://www.typhoonent.com/genesislogo.swf
With texture: http://www.typhoonent.com/genesislogotextured.swf

The filters: I'm using a glow filter to color it but since the texture colors it then I remove it.
code: var counter:Number = 1;
var nDec:Number = 0;
var gf:GlowFilter = new GlowFilter(0x01A954, 100, 100, 100, 400, 0, true, false);
onEnterFrame = function () {
if (--counter == 0) {
var dsf:DropShadowFilter = new DropShadowFilter(10, nDec, 0x000000, 100, 10, 10, 1, 3, false, false, false);
var bf:BevelFilter = new BevelFilter(5, nDec, 0xFFFFFF, 100, 0x000000, 100, 10, 10, 1, 1, "inner", false);
holder.filters = [gf, bf, dsf];
delete bf;
counter = 4;
nDec += 4;
if (nDec>359) {
nDec = 0;
}
}
};
This code attaches each letter and places them and then applies the texture
letterArray is pointing at each individual letter.
code: var bitSource:BitmapData = new BitmapData(sWidth, sHeight, true, 0xFFFFFF);

for (i=0; i<letterArray.length; i++) {
holder.attachMovie(letterArray[i],letterArray[i],++d);
holder[letterArray[i]]._xscale = holder[letterArray[i]]._yscale=scale;
if (i<1) {
holder[letterArray[i]]._x = xPos[i];
holder[letterArray[i]]._y = yPos[i]+stageBorder/2;
} else {
holder[letterArray[i]]._x = holder[letterArray[i-1]]._x+holder[letterArray[i-1]]._width+xPos[i]*scale/100;
holder[letterArray[i]]._y = yPos[i]+stageBorder/2;
}

//Texture
_root.createEmptyMovieClip("sourceClip"+i,++d);
bitSource.perlinNoise(random(30)+20,random(30)+20, random(23)+1,1,true,true,2,false);

this["sourceClip"+i].attachBitmap(bitSource,10,"auto",true);
this["sourceClip"+i]._width = holder[letterArray[i]]._width;
this["sourceClip"+i]._height = holder[letterArray[i]]._height;
this["sourceClip"+i]._x = holder[letterArray[i]]._x;
this["sourceClip"+i]._y = holder[letterArray[i]]._y;
this["sourceClip"+i].setMask(holder[letterArray[i]]);
}
Any ideas on how to fix this?

A-i Filter Question
seen this? http://www.a-i.tw/root.html?lang=en#pos=20

just curious about the mouseOvers when a project loads...what kind of filter is that? or is it?

Displacement Map Filter HELP
Hi! I want to make a movieclip look like a sphere, and then paste an image (like the earth) onto it, and then rotate, giving the effect of a rotating planet. I want to be able to rotate it in all directions. I've heard about Displacement Map Filter, and I have no idea on how to use it. I've already checked Flashkit for info, and all the links...but I still can't get a hang of it.

Can someone PLEASE explain it to me, and maybe provide a bit of source code so I have something to work with? This is really slowing down my big game project!!! Please help!

[F8] Filter An Array
I have an array that looks like this:
100_0061.JPG,100_0064.JPG,100_0068.JPG,100_0069.JP G,test.swf,test.fla

and the code that is building it:
//jpgs to load
basePath = mdm.Application.path + "presFiles/"
var myFiles:Array = mdm.FileSystem.getFileList(basePath, "*.*");
numberOfFiles = myFiles.length

How can I remove the swf and fla files and update the length of the array.

Thanks in advance!

Filter XML Attributes
Hey,
I'm working on an site with XML driven data. I have some actionscript that returns attributes from a childnode in the xml file. This pulls attributes from many different entries, and some are duplicates. I am trying to create a filter that will return each entry only once and reject it if it already exists in the list. Any suggestions on this? Hopefully my description isnt too vague. I can attach an example if needed. Thanks!

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!!!!

Filter Failure
well, I encountered a problem when I tried to apply the filter effecct on one image. But, suddenly there is this debug problem that came out. I tried the same thing on a lower sized picture but the same problem occur while processing the image. How can I deal with this problem

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