Flash Basics: Setting properties for movie clips

Source: Internet
Author: User
Tags execution visibility

Setting the properties of a movie clip is a more widely used statement in Flash as. In the Actions | "Global Functions" | "Movie Clip Control", we can set them by SetProperty. By SetProperty we can set the location, size, visibility, and so on for the movie clip.

1, first of all, we have a comprehensive understanding of the SetProperty function. We open the as panel, locate the SetProperty statement under Movie clip control, double-click, and its argument panel appears on the right. As shown in the figure


Figure: Proproperty Parameters Panel

2, in the parameters panel a total of three options, we take a look at their specific features. "Properties" refers to those attributes that you want to control the movie clip. In "Properties", Flash gives us the properties of 14 movie clips, and we can choose the settings as needed. Here are a few of the properties we often use, to introduce you in detail.

  〖_alpha〗 transparency Options. used to control the transparency of a movie clip. Let's combine the examples to introduce his usage.

First we draw a red circle and convert him to a movie clip, named "Name." We drag and drop the movie clip into the scene, and in the following property panel, fill in his name "name".

Then, we made three buttons to place on a separate layer, named "Button:alpha30", "Button:alpha85", "button:alpha:100" respectively. To set the effect of the property more intuitive, we draw a black rectangle at the bottom of the layer and use it to detect the transparency of the movie clip above.

Here we will set the button as, with as to control the movie clip's properties. We select the "Button:alpha30" button to open the as panel and add as:

On (release) {
SetProperty ("Yourname", _alpha,30);
}

According to the above method, the execution action in the "Button:alpha85" button is set to 85%, and the execution action in the "BUTTON:ALPHA100" button is set to 100%.

Finally, save the test. When we click on a different button, we get different transparency properties for this movie clip.

  〖_height〗 height option. used to control the height of a movie clip. Let's combine the examples to get a sense of his usage. First we make a movie clip, draw a rectangle above the center point in the movie clip editing area. Make three buttons at the same time. Place the movie clips and three buttons in separate layers, and enter a name for the movie clip named "Yourname" for control. Then we select the first button, open the As panel, and add as:

On (Press) {//When the button is pressed, perform the following action
SetProperty ("Yourname", _height, "100"); Increase the movie clip height property by 100%
}

For the same reason, we set the 2nd and 3rd buttons separately to increase the movie clip by 200% and 400% respectively.

Finally save the test, when we select the Stand-alone button, the movie clip "Yourname" The height of the property according to our settings and change.

  〖_highquality〗 High quality. used to control the quality of a film. The goal we control is still a movie clip named "Yourname". Highquality has two parameters, select 1, then high quality playback. Select 0, then vice versa.

  〖name〗 Change the name of the movie clip. Let's do an example to illustrate. We're going to have a video clip called "Yourname" for two buttons. Put the movie clip on the second frame on the first floor, and the two buttons on the other layer, first we use the name of the Set property on the first frame, change the movie clip names to "MyName" and add the action on the two buttons: The first button has the name "MyName" for the target movie clip that controls height heights, 100. The second button controls the height of the target movie clip name "Yourname", height 200. To save the test, you can see that the clip height changes when you click on the first button. When you click on the second movie clip, you don't change the height. This means that the second button does not control the movie clip. The reason is that we have changed the movie clip named "Yourname" to "myname".

  〖_rotation〗 rotation option. used to control the rotation angle of a movie clip. It is particularly noted that this rotation angle is relative to the original angle.

We set the value of the rotation of the three buttons to 20, 60,120 respectively. Add an action to each button:

On (Press) {//When the mouse is pressed perform the following action
Set Property ("Yourname", _rotation,20 (60,120));//Set the rotation angle of "yourname" to 20, 60 and 120 degrees respectively.
}

  〖_visible〗 visibility Options. used to set whether a movie clip is visible. Better understood when set to 1 o'clock, visible when set to 0 o'clock, not visible.

  〖_width〗 width option. used to set the width of a movie clip. His height options in French are the same, and this is not a tiring statement.

  〖_x〗x axis position. used to set the x-coordinate of a movie clip. The x-axis position is a concept, which is the right and left position. You can open the ruler under the View menu so that we can understand it.

  〖_xscale〗x axis Scale. sets the scaling scale of the movie clip on the x-axis. The normal value is 100.

  〖_y〗y axis position. with _x, is the top and bottom position of the movie clip.

  〖_yscale〗y axis Scale. with 〖_xscale〗.

  note that the--x axis, the y-axis settings are based on the scene as a reference. hint --the movie clip properties can be set up in combination with the copy command to achieve an orderly change effect.

  Summary: through the solution of this problem, we understand the various property settings of SetProperty. Later we can put this knowledge and other statements to cooperate with each other, slowly accumulate the ability to write statements.

   finally to provide you with the source file: Click here to download all source files Package

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.