Blogroll

This blog is created for education about engineering students.All the engineering students are get free downloadable books here. not only books and also different software also available here

9. Tinting a Movie Clip’s Color


9. Tinting a Movie Clip’s Color


Procedure:
step 1: Open flash 8
step 2: Select flash document
step 3: select 1st layer, 1st frame on that document and write source code on Actions Frame
step 4: To check output press ctrl+enter(test movie)

Source code:

this.createEmptyMovieClip("mc1",1);
this.createEmptyMovieClip("mc2",2);
this.blendMode="Layer";
this.createTextField("blendLabel",3,50,150,100,100);
fillClip(mc1,0x00AA00,0x22FFFF,100,100);
fillClip(mc2,0xFF0000,0x2211FF,100,50);
mc2._x=33;
mc2._y=33;
var blendModeIndex=0;
setInterval(changeBlendMode,1000);
function changeBlendMode()
{
 mc2.blendMode=blendModeIndex%14+1;
 blendLabel.text=(blendModeIndex%14+1)+":"+mc2.blendMode;
 blendModeIndex++;
}
function fillClip(mc:MovieClip,color1:Number,color2:Number,alpha1:Number,alpha2:Number)
{
 matrix={a:100,b:0,c:0,d:0,e:100,f:0,g:50,h:20,i:1};
 mc.beginGradientFill("linear",[color1,color2],[alpha1,alpha2],[0,0xFF],matrix);
 mc.lineStyle(8,0x888888,100);
 mc.moveTo(0,0);
 mc.lineTo(0,100);
 mc.lineTo(100,100);
 mc.lineTo(100,0);
 mc.lineTo(0,0);
 mc.endFill();
}

No comments:

Post a Comment

Total Pageviews