Using The Pixel Bender Filters in Actionscript 3.0

November 18, 2008 – 3:50 pm

The best thing about Pixel Bender filters is soon we will have more amazing effects. I am not a person which is has a great background of math and I never work with image processing or with C. But the great part of Pixel Bender is you can use filters which is been created from someone else. This is similar like using classes in action script. Someone wrote good class and opens for public and everybody is using. So even if you are not the one who wrote filter still is good to know how to use them.

In this article I will explain how to use Pixel Bender Filters in Flash Player. Well probably you know that Pixel Bender filters can be use in Flash and After Effects. But if you want to use in flash you have to export the Pixel Bender file for flash. For exporting .pbj file you have to select “Export Kernel Filter For Flash Player” in File menu. I assume you all ready did that and I am passing the code which will be use in Flash.

Read the rest of this article »

Beginning To Pixel Bender - 2

November 7, 2008 – 4:24 pm

This is a second part of “Beginning To Pixel Bender” article. If you didn’t read first one you can reach form the link at below.
http://enginyoyen.com/blog/eng/index.php/beginning-to-pixel-bender-1/

Colour Channels

32-Bit of image is have 4 color channels (A:alpha, R:red, G:Greeen, B:blue). Getting color channels in Pixel Bender is really easy. For reaching the channel color of pixel first you have to reach to pixel. For getting the pixel we can use sampleNearest() function. All we have to do is create a new variable and set data type as a pixel4. For assigning value to variable we will use the sampleNearest() function.

  1. pixel4 channels= sampleNearest(src,outCoord());

Read the rest of this article »

Beginning To Pixel Bender - 1

November 5, 2008 – 1:25 am

I cover topics such as; how pixel bender works, pbj file format, language in pixel bender, platform and couple more topics in “First Look To Pixel Bender” article. And now I will consider this article as a part of the old one. That’s why I recommend you to reading the first one before starting this one.

http://enginyoyen.com/blog/eng/index.php/first-look-to-pixel-bender/

In this article I will explain how you can code with Pixel Bender and create a filter file. The language in Pixel Bender is C based language, so that’s why it might be hard at the beginning. But I will try to make easy as possible, and explain each code with detail.

Pixel Bender Toolkit

First you do need a Pixel Bender off course. You can download to Pixel Bender Toolkit address at below;

http://labs.adobe.com/wiki/index.php/Pixel_Bender_Toolkit

If you all ready start to use Flash CS4 it’s coming with installation package. You can check your programs folders it might all ready be loaded. Of course if is not you can get IDE from labs.adobe for free.

I assume you all ready download or have it Pixel Bender for rest of article. Pixel Bender Toolkit has three basic areas;

Read the rest of this article »

Actionscript 3.0 Book is Out!

October 10, 2008 – 3:40 pm

Actionscript 3.0 Kitabı Çıktı!

After long nights of work finally the Actionscript 3.0 book is from now on available in any book store in country. The book covers basic elements of Actionscript 3.0. Those I tried to explain by also paying a lot of attention to of only giving explanations how methods functions, I preferred to figuratively show how the system of codes works.

I finished the book at the end of April. But because of the usual summer break the publisher decided to wait a bit longer. The book is written in Turkish and I truly hope it will find great respond among the Turkish readership as it is the only source on Actionscript 3.0 in Turkey so far.

Read the rest of this article »

First Look To Pixel Bender

September 14, 2008 – 8:36 pm

What is Pixel Bender?

Shortly Pixel Bender Toolkit is small IDE which allow you to create your own Bitmap Filter. With Flash 8 we start to use to filters for display objects. But those filters were basic filters (Glow, Blur, DropShadow etc). If you want to go one step further with filters than you need it to use matrix and color channels. But of course they were all somehow limited.

With Pixel Bender instead of basic filters you can create your own filters or visual effect that you want.

Ps: Click the link at below for basic usage of filters;
http://enginyoyen.com/blog/eng/index.php/using-filters-with-actionscript-30/

Read the rest of this article »

Using Filters With Actionscript 3.0

September 12, 2008 – 11:06 pm

You can use some of the filters which is being use in image programs such a Photoshop in Flash. Of course you can do this in IDE or you can do this by Actionscript. I will only mention how you can do it in Actionscript. The numbers of filters you an use in Actionscript is not just 7 or 8. Actually I can say this number is been decided by the user. This is more like up to your creativity and curiosity. You can also create new filters and manipulate them way you want. The other point I want to touch is new version of Flash Player (Code Name: Astro) has a special way to make your own filters. The filter made by a small program called Pixel Bender. But I explain and cover that with more detail in next articles.

Creating and Applying New Filter

Creating new filter is easy. Creating new filter is not different than a creating object. All you have to do create new Filter object with new statement than pass the parameters which is required. Most simple and most used one is Blur Filter;

  1. var blurFilt:BlurFilter = new BlurFilter (10, 10, BitmapFilterQuality.HIGH);

The blur filter takes 3 parameter. First one is blur amount that you want to apply x coordinate. Second one is amount of blut that you want to apply to y coordinate. The third parameter is the quality of blur which will be applied to display object. We can also show the code like this;

Read the rest of this article »

Beginning Of Event and EventListeners With Actionscript 3.0

August 16, 2008 – 9:42 pm

Event class had a big change with Actionscript 3.0. Those changes effect and make thins much easier for developers. The main idea behind that is having better controls on objects. Better control on codes it will decrease number of the errors. Also will help you too manipulate your code after while.

For example: You have made a project with Actionscript 3.0. Couple months after you finish project your costumer or employee wants to add a new functionality. Main problem over here will be adding code on a working system with out breaking functionality that is exist. Usually is hard to add some code on a system that is working. In this point is matter how good you can control your objects. If you can control your objects easily adding new codes will be easy. If is not you will have more serious problems about adding new functionality. And for more control you should definitely use the event class good.

What is Event?
Event is respond of an object to the other objects in Actionscript when some action happen. Best and easiest example is actions that happen when you click a button in Actionscript. But do not think of that only for buttons. Events can be in lots of types. Beginning of an animation, ending of animation, image that start to be load or anything like this can be an event. Any action that happens is beginning or ending of an event.

Event Listeners
Event listeners check or listen to object for any change or action. Event listeners give us information of did animation start, did some click button, did image loaded, did connect to server or any information like this. When expecting event occur event listeners run block of code which had been specified before.

Read the rest of this article »