LDropShadowFilter Class
The DropShadowFilter class lets you add a drop shadow to display objects. The shadow algorithm is based on the same box filter that the blur filter uses. You have several options for the style of the drop shadow, including inner or outer shadow and knockout mode. You can apply the filter to any display object (that is, objects that inherit from the DisplayObject class).
Constructor
LDropShadowFilter
-
distance -
angle -
color -
blur
Parameters:
-
distanceIntThe offset distance for the shadow, in pixels.
-
angleIntThe angle of the shadow.
-
colorIntThe color of the shadow.
-
blurIntThe amount of blur.
Example:
var bitmapdata = new LBitmapData(event.target);
var bitmap = new LBitmap(bitmapdata);
addChild(bitmap);
var shadow = new LDropShadowFilter(5,45,"#000000");
bitmap.filters = [shadow];
Methods
callParent
-
functionName -
arguments
call the method of parent。
Parameters:
-
functionNameStringfunction's name
-
argumentsArrayFixed value : arguments
Example:
function funA(){
LExtends(this,LObject,[]);
}
funA.prototype.myName = function(){
return "AAA";
}
function funB(){
LExtends(this,funA,[]);
}
funB.prototype.myName = function(){
return "BBB";
}
function funC(){
LExtends(this,funA,[]);
}
funC.prototype.myName = function(){
return this.callParent("myName",arguments);
}
LInit(1000/50,"legend",800,150,main);
function main(){
LGlobal.setDebug(true);
var objB = new funB();
trace(objB.myName());//BBB
var objC = new funC();
trace(objC.myName());//AAA
}
setAngle
-
angle
Set the angle of the shadow.
Parameters:
-
angleIntthe angle of the shadow.
setBlur
-
blur
Set the amount of blur.
Parameters:
-
blurIntthe amount of blur。
setColor
-
color
Set the color of the shadow.
Parameters:
-
colorIntthe color of the shadow.
setDistance
-
distance
Set the offset distance for the shadow.
Parameters:
-
distanceIntthe offset distance for the shadow.
Properties
objectIndex
Int
public
ID of the object
