Filters (Button.filters Property) - MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE Reference

Actionscript 2.0 language reference
Table of Contents

Advertisement

//button code
// the following function will not get called
// because myBtn2_btn.enabled was set to false
myBtn1_btn.onRelease = function() {
trace( "you clicked : " + this._name );
};
myBtn2_btn.onRelease = function() {
trace( "you clicked : " + this._name );
};

filters (Button.filters property)

public filters : Array
An indexed array containing each filter object currently associated with the button. The
package contains several classes that define specific filters that you can use.
flash.filters
Filters can be applied in the Flash authoring tool at design-time, or at runtime using
ActionScript code. To apply a filter using ActionScript, you must make a temporary copy of
the entire
Button.filters
the temporary array back to the
object to the
Button.filters
named
:
myButton
myButton.filters[0].push(myDropShadow);
To add a filter using ActionScript, you must follow these steps (assume that the target button
is named
):
myButton
Create a new filter object using the constructor function of your chosen filter class.
Assign the value of the
.
myFilters
Add the new filter object to the temporary array,
Assign the value of the temporary array to the
If the
array is empty, you need not use a temporary array. Instead, you can directly
filters
assign an array literal that contains one or more filter objects that you have created.
To modify an existing filter object, whether it was created at design-time or at runtime, you
must use the technique of modifying a copy of the
Assign the value of the
.
myFilters
Modify the property using the temporary array,
set the
property of the first filter in the array, you could use the following code:
quality
myList[0].quality = 1;
Assign the value of the temporary array to the
array, modify the temporary array, and then assign the value of
Button.filters
array. The following code has no effect on the target button,
array to a temporary array, such as one named
myButton.filters
array to a temporary array, such as one named
myButton.filters
array. You cannot directly add a new filter
.
myFilters
array.
myButton.filters
array:
filters
. For example, if you want to
myFilters
array.
myButton.filters
Button
355

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Flash 8

Table of Contents

Save PDF