338
ActionScript classes
var w:Number = 100;
var h:Number = 100;
rect.beginFill(0x003366);
rect.lineTo(w, 0);
rect.lineTo(w, h);
rect.lineTo(0, h);
rect.lineTo(0, 0);
rect._x = 20;
rect._y = 20;
var filter:BlurFilter = new BlurFilter(30, 30, 2);
var filterArray:Array = new Array();
filterArray.push(filter);
rect.filters = filterArray;
return rect;
}
clone (BlurFilter.clone method)
public clone() : BlurFilter
Returns a copy of this filter object.
Availability:
ActionScript 1.0; Flash Player 8
Returns
flash.filters.BlurFilter
- A new BlurFilter instance with all the same properties as the
original BlurFilter instance.
Example
The following example creates three BlurFilter objects and compares them. You can create the
filter_1
object by using the
BlurFilter
constructor. You can create the
filter_2
object
by setting it equal to
filter_1
. You can create the
clonedFilter
object by cloning
filter_1
. Notice that although
filter_2
evaluates as being equal to
filter_1
,
clonedFilter
does not, even though it contains the same values as
filter_1
.
import flash.filters.BlurFilter;
var filter_1:BlurFilter = new BlurFilter(30, 30, 2);
var filter_2:BlurFilter = filter_1;
var clonedFilter:BlurFilter = filter_1.clone();
trace(filter_1 == filter_2); // true
trace(filter_1 == clonedFilter); // false
for(var i in filter_1) {
trace(">> " + i + ": " + filter_1[i]);
Содержание FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
Страница 1: ...ActionScript 2 0 Language Reference ...
Страница 1352: ...1352 ActionScript classes ...