Forum Topic: AS : Filters

(2,028 views • 17 replies)

This topic is 1 page long.

<< < > >>
None

Inglor

Reply To Post Reply & Quote

Posted at: 9/12/05 02:32 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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.


None

Rantzien

Reply To Post Reply & Quote

Posted at: 9/12/05 02:37 PM

Rantzien FAB LEVEL 15

Sign-Up: 01/27/05

Posts: 3,426

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

None

liaaaam

Reply To Post Reply & Quote

Posted at: 9/12/05 02:46 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,534

FINALLY A USE FOR MY GENIUS.

Heh, link :)


None

Inglor

Reply To Post Reply & Quote

Posted at: 9/12/05 03:06 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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


None

fwe

Reply To Post Reply & Quote

Posted at: 9/12/05 03:14 PM

fwe DARK LEVEL 08

Sign-Up: 07/24/03

Posts: 3,361

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


None

Inglor

Reply To Post Reply & Quote

Posted at: 9/12/05 03:16 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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


None

Rustygames

Reply To Post Reply & Quote

Posted at: 9/12/05 03:37 PM

Rustygames LIGHT LEVEL 18

Sign-Up: 05/07/05

Posts: 6,662

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


None

Glaiel-Gamer

Reply To Post Reply & Quote

Posted at: 9/13/05 06:22 PM

Glaiel-Gamer NEUTRAL LEVEL 27

Sign-Up: 12/28/04

Posts: 8,044

bump for flash 8!


None

cherries

Reply To Post Reply & Quote

Posted at: 9/13/05 06:25 PM

cherries LIGHT LEVEL 18

Sign-Up: 06/07/05

Posts: 4,576

does this mean this tut is now rendered ussless?
since flash 8 is out


None

Paranoia

Reply To Post Reply & Quote

Posted at: 9/13/05 06:25 PM

Paranoia DARK LEVEL 34

Sign-Up: 04/22/05

Posts: 9,699

Woah I've fallen in love with Flash 8

BBS Signature

None

Inglor

Reply To Post Reply & Quote

Posted at: 12/9/05 02:18 PM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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


None

alexhall

Reply To Post Reply & Quote

Posted at: 1/7/06 06:56 PM

alexhall LIGHT LEVEL 10

Sign-Up: 07/25/04

Posts: 21

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


None

reelbigcheese

Reply To Post Reply & Quote

Posted at: 1/7/06 07:13 PM

reelbigcheese LIGHT LEVEL 18

Sign-Up: 08/12/05

Posts: 2,162

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


None

alexhall

Reply To Post Reply & Quote

Posted at: 1/8/06 01:09 PM

alexhall LIGHT LEVEL 10

Sign-Up: 07/25/04

Posts: 21

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


None

125Maniac

Reply To Post Reply & Quote

Posted at: 3/1/08 12:54 AM

125Maniac EVIL LEVEL 12

Sign-Up: 09/14/07

Posts: 367

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.


None

Yambanshee

Reply To Post Reply & Quote

Posted at: 3/28/09 08:38 AM

Yambanshee DARK LEVEL 11

Sign-Up: 10/05/08

Posts: 1,554

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

None

Yambanshee

Reply To Post Reply & Quote

Posted at: 3/28/09 08:40 AM

Yambanshee DARK LEVEL 11

Sign-Up: 10/05/08

Posts: 1,554

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

All times are Eastern Standard Time (GMT -5) | Current Time: 04:45 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!