Gradually appearing Mosaic

Source: Internet
Author: User
First, import an image into the scene and convert it into a video clip.
The first shot of video editing in the main scenario

Write the following

Onclipevent (load) // when a video clip appears on the timeline, execute the statement in braces {
Numy = 56;
Numy = 70; // defines the size of the image display.
Numperframe = 60 // define the needle speed
Currsquare = 0;
Choices = new array ();
For (I = 0; I <numx * numy; I ++ ){
Choices. Push (I); // defines a new array and increases the length of the array.
}
_ Root. createemptymovieclip ("Mask", 0 );//
This. setmask (_ root. Mask); // creates a video clip as a shadow.
Function drawsquare (x, y ){
With (_ root. Mask ){
MoveTo (x, y );
Beginfill (0x000088 );
Lineto (x + 10, y );
Lineto (x + 10, Y + 10 );
Lineto (X, Y + 10 );
Endfill (); // draw this screen, which is a 10*10 pixel square.
}
}
}
Onclipevent (enterframe) // video clip pin frequency continuously triggers this action {
If (currsquare <numx * numy ){
For (I = 0; I <numperframe; I ++ ){
J = random (choices. Length );
T = choices [J];
Choices [J] = choices [choices. Length-1]
Choices. Pop (); // start to delete elements in the array choices
X = T % numx;
Y = math. Floor (T/numx); // return the lower limit of the expression in the Parameter
Drawsquare (x * 10, y * 10 );
}
Currsquare + = numperframe;
This. _ alpha = currsquare/(numx * numy) * 100; // sets the transparency.
}
}

Now you can export the results.

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.