00:00
00:00
Newgrounds Background Image Theme

LOCKdev just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

AS : Filters 2005-09-12 14:32:39


AS: Main, go give mr D some tough luvin'

This will cover filters very basically

note, these filters only work in flash 8+

so what are filters

a very basic and effective way to give your pictures very nifty effects :)

now how do I use em?

take it easy now billy, it's not hard but it's not that easy, every movieclip has it's own filters array, that array contains all the filters applied to that movieclip, by default, none.

If you want to add a filter to a movieclip that already has filters you need to do the following :

1)Create a new filter object, using the constructor (the creating function) from the filter you need
2)Assign it to mymovieclip.filters, to a temporary array
3)Add the new filter to that array
4)Assign the value of the temp array to the .filters array

as far as I know other ways don't work if you have already assigned a filter. For movieclips with no current filters, you can add the new filter directly to the (empty) .filters array.

If you need to alter an existing filter, you must first assign the movieclip's .filters to a temp array and modify the property using the temporary array. you can do temparrayname[5].propertya=valuea; directly from that point on or reassign the filter to a filter object and do it indirectly.

If you want to delete all the filters in a movieclip all you got to do is use
movieclipname.filters=new Array();

Actual Usage

Shadows

examples copied from the flash 8 documenation

shadows are rather easy, to set up a basic one you can simply do :
var myDropFilter = new flash.filters.DropShadowFilter();
var myFilters:Array = myMC.filters;
myFilters.push(myDropFilter);
myMC.filters = myFilters;

naturally it has properties , those properties are :

distance - the distance of the shadow from the target MC
angle -the angle of the shadow
color - the color of the shadow
alpha - the alpha of the shadow, values between 0 and 1 where .5 for example is 50% alpha
blurX - amount of horizontal blur (between 0.0 to 255.0 )
blurY - amount of vertical blur (between 0.0 to 255.0 )
strength - the spread of the color
quality - the quality of the shadow

Blur filter
for example
var myBlurFilter = new flash.filters.BlurFilter(x,y,quality);
var myFilters:Array = myMC.filters;
myFilters.push(myBlurFilter);
myMC.filters = myFilters;

x stands for the _x blur
y stands for the _y blur
the quality stands for the quality of the blur

I will cover other filters like bevel and such later on :) I just wanted to make another AS: tutorial since for two pages on AS main none serious have been made. hope this tutorial helps, ask any questions

I have used the unofficial documentation, once it's publicly available, I'll add a link to it.

Response to AS : Filters 2005-09-12 14:37:07


Man, I'm getting more and more excited about buying Flash 8 for every day that passes. Unfortunately, it'll probably be a while still, with my lousy salary.


BBS Signature

Response to AS : Filters 2005-09-12 14:46:58


FINALLY A USE FOR MY GENIUS.

Heh, link :)


Sup, bitches :)

BBS Signature

Response to AS : Filters 2005-09-12 14:53:52


Wow, nice tutorial!


BEER BEER BEER BEER BEER BEER BEER BEER BEER BEER BEER

BEER BEER BEER BEER BEER BEER BEER BEER BEER BEER BEER

BEER BEER BEER BEER BEER BEER BEER BEER BEER BEER BEER

BBS Signature

Response to AS : Filters 2005-09-12 15:06:47


At 9/12/05 02:46 PM, -liam- wrote: FINALLY A USE FOR MY GENIUS.

Heh, link :)

pretty cool liam :) not that hard to make nontheless useful, now add animated blurs and such :)

Response to AS : Filters 2005-09-12 15:14:00


There's no point in making it now though, since flash 8 isn't even out and most of us don't have a beta. You probably should wait until it comes out, to get referance from the official help files, in order to make sure you don't miss anything


wtfbbqhax

Response to AS : Filters 2005-09-12 15:16:46


of course there is a point of making it now:

1)A lot of people use the bitchange "hack" to produce version 8 swf files (it's legal though)
2)Those people don't get any documentation or tutorials

Response to AS : Filters 2005-09-12 15:37:43


At 9/12/05 03:16 PM, Inglor wrote: of course there is a point of making it now:

1)A lot of people use the bitchange "hack" to produce version 8 swf files (it's legal though)
2)Those people don't get any documentation or tutorials

Yes inglor is right I am so desperate to use this I cannot wait until flash 8 comes out OMG please someone control my excitement about using the new AS in flash 8 a few weeks early


- Matt, Rustyarcade.com

Response to AS : Filters 2005-09-13 18:22:14


bump for flash 8!

Response to AS : Filters 2005-09-13 18:25:23


Woah I've fallen in love with Flash 8


BBS Signature

Response to AS : Filters 2005-12-09 14:18:39


At 9/13/05 06:25 PM, -cherries- wrote: does this mean this tut is now rendered ussless?
since flash 8 is out

no, it means it was rendered useless before :P

Response to AS : Filters 2006-01-07 18:56:22


you could just turn it into a movie clip got to properties select filters and select what filter you want.

Response to AS : Filters 2006-01-07 19:13:18


At 1/7/06 06:56 PM, papperboy wrote: you could just turn it into a movie clip got to properties select filters and select what filter you want.

they were talking about using the filter's dynamically through AS see liam's example at the top XD

Response to AS : Filters 2006-01-08 13:09:49


At 1/7/06 07:13 PM, -reelbigcheese- wrote:
At 1/7/06 06:56 PM, papperboy wrote: you could just turn it into a movie clip got to properties select filters and select what filter you want.
they were talking about using the filter's dynamically through AS see liam's example at the top XD

ok

Response to AS : Filters 2008-03-01 00:54:19


This will come in very useful when I start making some violent game or another!

Just a question:
Is there any difference between using the flash IDE filter, or does AS say, lack file size.

Response to AS : Filters 2009-03-28 08:38:49


is there any obvious problem with this code? its on a duplicated MC

var myBlurFilter = new flash.filters.BlurFilter(random(10), random(10), low);
var myFilters:Array = this.filters;
myFilters.push(myBlurFilter);
this.filters = myFilters;

It doesint seem to be applying the filter.
also, does this method lower the file size, and/or make less lag?


AS2||AS3||Motox

Thanks to hdxmike for the sig :]

BBS Signature

Response to AS : Filters 2009-03-28 08:40:20


At 3/28/09 08:38 AM, Yambanshee wrote: is there any obvious problem with this code? its on a duplicated MC

yes there is. the quality. my bad


AS2||AS3||Motox

Thanks to hdxmike for the sig :]

BBS Signature