Childhood memories are always good, remember when you were a child watching open-air movies on the playground scene? In this case, I teach you how to use flash to achieve the effect of old movie playback. In fact, the effect of making old movies, mainly to catch the old movie playback a bit jitter, flickering, the screen is not clear features such as design, the use of very little code. Where the _x, _y properties can make the picture jitter, _alpha attributes change the transparency of the picture. The effect is shown in Figure 1 and the following is the production method.
Effect Preview
source File Download:
Click here to download
1. Create a new Flash document, click the Size button in the Properties panel, and open the document Properties panel to set the scene size to 500px x 360px, black background. Frame frequency is 15fps.
2. Press the shortcut key Ctrl+f8 to open the Create new symbol panel and create a movie clip symbol called Movie. Next, press the shortcut key ctrl+r in its edit scene to import an old movie picture. Note: Make the top left corner of the picture overlap The center of the scene, as shown in Figure 1. You can press the shortcut key ctrl+i to open the Info panel for secondary settings, as shown in Figure 2. This is done so that when the component is placed in the main scene, it is easier to determine its coordinate value when programming.
Figure 2
3. Go back to Scene 1 and press the shortcut key ctrl+l to open the library panel and drag the movie symbol from the library to the scene. Click the movie symbol in the scene, press the shortcut key ctrl+k to open the Alignment panel, click the Relative vs Stage button, and then click the horizontal alignment and vertical alignment two buttons, as shown in Figure 3, to make the movie symbol centered in the scene.
Figure 3
4. Click the movie symbol in the scene, press F9 to open the Actions panel, and type the following code:
Change the position and transparency of the movie symbol
Onclipevent (enterframe) {
this._x = Math.random () *2+90;
This._y = Math.random () *2+60;
This._alpha = Math.random () *30+50;
}
Onclipevent is an event handler that triggers the action defined for the movie clip instance; This refers to an object or movie clip instance; _x, _y Properties change the position of the component, _alpha properties change the transparency of the component, and Math.random () produces a random number from 0 to 1.
This example of the production method and its simplicity, even if the beginning of learning Flash readers can be done effortlessly.