Production of flash film effects

Source: Internet
Author: User

Display objects in AS3 have a transform property that can be set to change the size, rotation, and color characteristics of the display object. The Transform property also has its own properties, The ColorTransform property can change the color of the display object. The ColorTransform property must be set using new. Format:

Display objects. Transform.colortransform = new ColorTransform (red multiplier, green multiplier, blue multiplier, transparency multiplier, red offset, green offset, blue offset, transparency offset)

According to the as Help file, the multiplier has a range of 0-1, and the offset value is 0-255. When you set the. Transform.colortransform property, the color of the display object is recalculated.

Calculate the formula with red as an example: the new red = Old Red * Red multiplier + red offset value.

According to this formula, we have a whim, if the multiplier is set to-1, the offset is set to the maximum 255, is the color not exactly the opposite? That is to say that black will become white, White will become black, this is not a negative effect? However, the help file said, the multiplier is the range of 0-1, then you dare to try? Set to-1 that's not a rule? In his Fan, he did not dare. You have a lot of guts, so you have the RGB multiplier set to-1, the offset value set to 255, and then you with an uneasy heart (not hemp), test the film, what will happen? System paralysis, or computer explosion? Oh, That's serious. Test results, you see a negative effect, steal the fun you.

Well, the principle you should already know, now we make.

1. First find a picture, import into Flash, create a new movie clip, put the picture in, put it well.

2. Back to the main scene, drag the picture components onto the stage, then copy one, level and discharge well.

3. Set the instance name for the picture component to be made into a negative: FILM_MC.

4. With black fill, transparency set to 70-80%, draw a rectangle larger than the picture element and place it below the FILM_MC. Then use a white fill to draw a small rectangle, place it on top of the black rectangle, copy several, and then select all the white rectangles, open the alignment panel, and cancel the relative to the stage setting, Then click on the alignment, then click on the horizontal center average interval. Copy a portion of the bottom of the black rectangle. The following figure:

To create a new layer, open the Action panel and enter the following code:

Film_mc.transform.colorTransform = new ColorTransform ( -1,-1,-1,1,255,255,255,0);

Film_mc.scalex =-1;

Test the film, how effective?

The second line of code above is to flip the picture horizontally because I feel the film's direction seems to be reversed.

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.