Search Tutorials
Declaring & Defining Line 1 : Declaring the functionmyColorizing(myred,myRedOffset,mygreen,myGreenOffset,
myblue,myBlueOffset,myAlpha,myAlphaOffset){
First we need to declare the new function by naming it "myColorizing" and naming the 8 parameters (the color components) that have to be passed to it. Note: Not all functions require parameters but this one does. The order of the variables is important - you must maintain the order defined in the function itself (i.e. if your function is myMinus(A,B) and calculates (A - B) inside it, then if you don't maintain the order of the variables when you call it, it will calculate (B - A). This will result in errors.)
When we will call the function, the 8 values will be passed to it and look something like this: (of course you will not actually see this at run-time, this is only to help you visualise the passing of parameter values) myColorizing(100,170,0,0,0,-160,100,0)Line 2 : Defining the new Color myObjColor = new color(_root.myObject); In this line we define a new color characteristic to our movieclip ("myObject") and assign it the name "myObjColor". The "new color()" constuctor can be found under the "color" submenu inside the "objects" menu in the toolbox. This is what gives our movieclip the ability to change its color. Line 3 : Defining the new ObjectmyObjTransform = new object(); This is the virtual object I mentioned before - the "new object()" can be found in the "object" submenu under the "objects" menu in the toolbox. We must define a new object because we want to influence its properties - and if there is no object, there are no properties to modify.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|