How flash sets the translucent effect of dynamic text

Source: Internet
Author: User
Tags remove filter

Normally we use _alpha (AS2), alpha (AS3) to set the transparency value of an object, but using Alpha settings for dynamic text (or input text) is not valid. Online General Introduction method is to use draw bitmap way to deal with this problem, but this method is more troublesome, and later found that the original use of filters seems to be the text box into bitmap mode ... (The conceptual stuff doesn't understand, maybe not the reason, anyway, to achieve our effect), so use the filter mirror text box, you can set the alpha value normally, so there is the following function (note is AS2 code, AS3 Also, this is not much to say).

Import Flash.filters.BlurFilter;

Import Filter Class ... I chose a filter here.

Sets the filter. All values are set to 0 (no effect) so that the input box will display alpha correctly

function Enabledalpha (obj:object) {

Obj.filters = [New Blurfilter (0,0,0)]

}

Remove filter and return to normal state

function Disabledalpha (obj:object) {

Obj.filters = null

}

Use, txt to dynamic text instance name

Enabledalpha (TXT)

Txt._alpha = 50

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.