Wednesday, October 6, 2010

Selected examples of Flash mouse effects (5)


Section V: punt

"Punt," name suggests means that there is a suspension effect of the ball, in this case to achieve a suspended ball is under the control of the mouse movement and change in size, mainly in the production process is controlled using the ActionScript scripting, such as control the mouse drag the startDrag () function, get and set object-related properties getProperty () and setProperty () function. The net effect of film as shown in Figure 5.1, to achieve this effect, the specific steps are as follows:



Figure 5.1 punt

1. Build a new movie, through the property panel set its size 400pxX200px (in units of pixels) as the background color # FFFFFF, as used in the production process the background image, so choose what kind of background color is not very important.

2. Build a new video clip "ball movie", the movie clip function is drawn with a shadow of a small ball, first of all for ease of understanding, the default layer renamed "ball", shortcut keys "o", select the Ellipse tool Hold down the "Shift" to draw in the work area of a circle, and remove the profile lines, open the "Color mixer" panel for setting shown in Figure 5.2:



Figure 5.2 Set fill color

No profile is selected by drawing a circle, shortcut keys "K", select the paint bucket tool, the use of set above the fill color, and adjust its light into the shooting at the upper right corner to the lower right corner from the injection, so that when the production of shadow have real feelings, as shown in Figure 5.3:



Figure 5.3 Fill the use of color




[Next]



3. Insert a new layer "shade", use the ellipse tool to draw a small oval ball in the lower right corner to delete the corresponding contour lines, and set its fill color, the effect shown in Figure 5.4:



Figure 5.4 Drawing the shadow of the ball

4. Back to the main scene, the Press shortcut keys "Ctrl + R" to open the Import dialog box, to import a picture card, shortcut keys "Q" select the deformation tool to import any image adjustment to fit the size, that is, the size of overlap with the film on it, as shown in Figure 5.5:



Figure 5.5 Import Images

5. Select the first four, click the right mouse button select "Insert Frame" menu command, in the first four insert one, then build a new layer "line", the layer is the number of black lines drawn, when the ball move above the ground in some of the above three-dimensional feeling, select the first one to insert a key frame, shortcut keys "N", select the line tool, and set the line thickness to "1", color is black, in the work area Draw a line as shown in Figure 5.6, and inserted in the first four frames.



Figure 5.6 Drawing lines

6. Build a new layer "ball", select the first one to insert a key frame, the movie clip "ball movie" from the Library panel, drag and drop to the work area, create an instance, take an instance named "ball_mov" ( In the Properties panel can be set), inserted in the first four frames, the effect shown in Figure 5.7:



Figure 5.7 in the main scene to create "ball movie" examples

7. The next job is to add the ActionScript to do a movie script, and build a new layer "ACTIONS", in the first frame, insert a key frame and the frame to add the following script:

startDrag ("/ ball_mov", true, 30, 30, 355, 129);

file / / that to allow haulage instance "ball_mov", (30,30) and (355,129) for the diagonal of the coordinate values, that the scope of the mouse drag.

startDrag usage is as follows:

startDrag (target, [lock, left, top, right, bottom])

target to drag the movie clip target path.

lock a Boolean value that specifies a draggable movie clip is locked to the mouse in a central location (true), or locked to the user first click on the movie clip position (false). This parameter is optional.

left, top, right, bottom relative to the parent movie clip coordinate value, these coordinates specify the constraints of the movie clip rectangle. These parameters are optional.

In section 2, insert a key frame and the frame to add the following code:

scale = getProperty ("/ ball_mov", _y) / 2;
file / / get instance of "ball_mov" of the vertical coordinate values, and divided by 2
setProperty ("/ ball_mov", _xscale, scale);
file / / will assign the instance of the above scale of the properties of ball_mov. _xscale, said horizontal zoom
setProperty ("/ ball_mov", _yscale, scale);
file / / Ibid, said that the instance "ball_mov" vertical magnification.
In the first three insert a key frame, to add the following code:
gotoAndPlay (_currentframe-1);
file / / return the first two for loop

4 posts inserted in a key frame, to add the following code:

stop ();

8. This whole air-ball effect on the county finished, save the work, according to "ctrl Enter" preview of the final results.






Recommended links:



Acer aspire one aoa150 1165 netbook review



AVI to DivX



QuickTime to MPG



M2TS CONVERTER



No comments:

Post a Comment