Mask and mask simultaneous image switching-grid switching

Source: Internet
Author: User
Tags split

First look at the effect:


This is the first image switching based on the addition of a number of surface effects to do, the method is not complicated, as long as a layer, put on the top, the content as the mask layer on the line.
Specific practices:
1. Open the last time you made the FLA file, save it as a new document, or copy a copy directly under Windows. Do a second kind of special effects.
2. As a surface effect, you should add a layer above the mask layer. Next, copy the Mask layer contents to the newly added layer.
Because the last surface is not to see anything covered, so the inside mask animation must be the last frame or nothing, or completely transparent. But, in order not to change the original animation, we copy a component copy.
3. Maskfield, right-copy component, named MASKFIELD2, instance name, just copied in the dot.
4. Double-click MASKFIELD2, enter the editing state, in 3 of the method to mask copy a copy MASK2, instance name can or mask.
5. Double-click to enter MASK2, edit MASK2. Here is an animation scheme: first delete all the original frames, and then in the first frame to draw the same size as the original square. Color to white, alpha to 0%, and then in frames 7th and 15th, respectively, insert a keyframe, Change the alpha of the square in frame 7th to 100%; Create a shape tween animation between 1th to 7th and 7th to 15th frames.
6. Then, the control component also copies a CONTROL2 copy of the second frame inside the code to make a few minor changes: it is to change the inside of the Maskfield all to MASKFIELD2.
So finally, the three-frame code is
FRAME1:

step=5//defines the number of squares to appear in each time axis cycle, if too few, image switching takes a long time, too big, the computer burden is big, and the effect is too fast, it is not good to see.
num=0//records the number of mask copied.

FRAME2:

For (J=1 j<=2; j + +) {
For (I=num i<=num+step; i++) {
Duplicatemovieclip ("_parent.maskfield.mask", "Mask" +i, I);//Copy the corresponding MC
_parent["Maskfield" +j]["mask" +i]._x = _parent.index[i].split ("_") [0]*25
_parent["Maskfield" +j]["mask" +i]._y = _parent.index[i].split ("_") [1]*25
The location of the MC is defined according to the randomly assigned index. 25 of which is the side length of the square.
}
}
if (num>_parent.maxhor*_parent.maxver-1) {
This condition means that the number of copies is sufficient and the copy is complete, so stop.
Stop ();
}else{
num + + math.min (_parent.maxhor*_parent.maxver-num, step);
Otherwise, record the number of MC copies of this run.
}

FRAME3:

gotoAndPlay (2);

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.