Flash - Create old pixel effect |
| BELOW IS THE EXAMPLE OF WHAT WE ARE GOING TO CREATE. |
| In this tutorial I will show you how to create pixel effect |
| Create a new flash document and set the dimensions as per your image. |
| Create a new symbol (Ctrl+F8), select movieclip from the options box and name it image_MC. You will now be inside the movieclip. |
| Add your image. So go ahead and import your image to stage and centerize it. |
| On the main stage select the movieclip, press (F9) to open the actions panel and add the following script. |
| onClipEvent (load) { numY = 40; numX = 200; numPerFrame = 120; currSquare = 0; choices = new Array(); for (i=0; i<numX*numY; i++) { choices.push(i); } _root.createEmptyMovieClip("mask", 0); this.setMask(_root.mask); function drawSquare(x, y) { with (_root.mask) { moveTo(x, y); beginFill(0x000088); lineTo(x+5, y); lineTo(x+5, y+5); lineTo(x, y+5); endFill(); } } } onClipEvent (enterFrame) { if (currSquare<numX*numY) { for (i=0; i<numPerFrame; i++) { j = random(choices.length); t = choices[j]; choices[j] = choices[choices.length-1]; choices.pop(); x = t%numX; y = Math.floor(t/numX); drawSquare(x*5, y*5); } currSquare += numPerFrame; this._alpha = currSquare/(numX*numY)*100; } } |
Hope you enjoyed this small tutorial on how create pixel effect in flash |
About Us :
We are a Mumbai ( India ) based webdesigning company. The recent changes
in web design standards has brought in lots of misunderstandings
and misconceptions. The idea behind the web 2.0 standardisation .... read the complete article
We use following tools / packages and technologies for creating
client websites.