- Create new Flash File (File->New or Ctrl + N) and Name it as Emboss effect.
- Import image which you want to apply emboss effect
- Convert this image as an movieclip using Modify->covert to symbol or press F8.and name it as mcEmboss.Refer below image
- Click on this Movieclip and set Instance name as "mcEmboss".
- Drag and put buton component from componts , and name it as "btn_emboss".
- Create new Layer called "script" and open the Action layer
- Create one more layer , and drag and drop the movieclip called "smoke" .
- Paste the following code inside
import flash.filters.* ;
btn_emboss.onPress=function()
{
var myConvolution:ConvolutionFilter = new ConvolutionFilter(3, 3);
mcEmboss.myList = new Array();
mcEmboss.myList.push(myConvolution);
mcEmboss.filters = mcEmboss.myList;
var matrix1:Array = new Array(4, 1, 0,
1, 1, -1,
0, -1, -4);
templist = mcEmboss.filters;
templist[0].divisor = 1;
templist[0].bias = 0;
templist[0].matrix = matrix1;
mcEmboss.filters = templist;
}
- Now give ctrl+Enter to run the player.
Download the Source code from here.