AS3 use filters to implement highlighting (Glowfilter) __AS3

Source: Internet
Author: User

Effect chart

Before highlighting:

Highlight:


Import Flash.display.MovieClip;
Import flash.events.MouseEvent;
Import Flash.filters.GlowFilter;

var filter:array = [New Glowfilter (0xffffff,0.5,64,64,6,1,true)]
var rolemc:movieclip = this.role;
Rolemc.addeventlistener (mouseevent.mouse_move,onmouseover);
Rolemc.addeventlistener (mouseevent.mouse_out,onmouseout);


function OnMouseOver (e:mouseevent): void{
	rolemc.filters = filter;

function onmouseout (e:mouseevent): void{
	rolemc.filters = [];
}

Use the Glowfilter class to apply a glow effect to a display object. There are several options for the glow style, including inside or outside glow and knockout mode. When the distance and angle properties of the projection filter are set to 0 o'clock, the Glow filter is very similar to the projection filter. You can apply filters to any display object (that is, objects inherited from the Displayobject class), such as MovieClip, SimpleButton, TextField, and video objects, and BitmapData objects.


Glowfilter Related parameters:

Alpha:number
The Alpha transparency value of the color.

Blurx:number
Horizontal fuzzy quantity.

Blury:number
The vertical blur amount.

Color:uint
Halo Color.

Inner:boolean
Specifies whether the glow is an inner glow.

Knockout:boolean
Specifies whether the object has a knockout effect.

Quality:int
The number of times the filter was applied.

Strength:number
The strength of the stamp or spread.


Reference:

Http://help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/flash/filters/GlowFilter.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.