Learn about flash ActionScript programming considerations

Source: Internet
Author: User
Tags goto relative

1, familiar with the three ways to add action

Add on the frame, add on the MC, add on the button. With play, stop, Goto These three orders repeated practice. Don't use too many orders to give yourself a stun pill. Practice with the example, do not empty practice.

2, familiar with the button and MC to add action methods.

3, learning programming the most important thing-the description of the path

(1) _root.mc1.mc2. ... mcn.play () [or Stop (), _x, ...]

(2) _parnet

(3) This

(4) MC1.MC2. ...

(5) _LEVELN.MC1.MC2. ... mcn.play () [or Stop (), _x, ...]

Practice such an example may be helpful to you: Put a song you like to listen to a random in a MC, at random in a MC or button on the action to control it, want to stop it, want to let it put on.

4, understand the sequence of code execution

Layer default is to execute from bottom up

Level is executed from the bottom up

Frames are executed with the actual playback order

The code itself executes from the top down line

5. Understand two kinds of coordinate system

The coordinates of the scene, O point in the upper left corner, Y axis downward is increased x right is increased

Component coordinates, O Point in Assembly Center, Y axis downward is increase x right is increased

6, understand three kinds of text fields

Static stylistic field: the same as writing tools for typesetting software.

Dynamic text fields and input text fields: actually look at them as two variables, just visible variables.

7. Learn more about GOTO statements

Prevframe () jumps to and stops at the previous frame.

NextFrame () jumps to and stops the next frame.

Prevscene () jumps to and stops at frame 1th in the previous scene.

Nextscene () jumps to and stops frame 1th in the next scene.

gotoAndPlay ([Scene,] frame)

Jumps to the scene scene (omitting the frame frame that represents the current scene) and plays it.

gotoAndStop ([Scene,] frame)

Jumps to the scene scene (omitting the frame frame that represents the current scene) and stops.

8, to understand the various types of MC can be rewritten properties

_x Center Point relative to x coordinate (pixel unit)

_y Center point relative y-coordinate (pixel unit)

_xscale horizontal scaling, initially 100

_yscale vertical scaling, initially 100

_rotation Relative rotation angle (degree unit)

_width relative display width (pixel units)

_height relative display height (pixel units)

_alpha Display Transparency (0~100)

_visible is visible

_focusrect whether to show the focus box

9. Three major disciplines

(1) Write code must be in English input method.

(2) The MC property without loading is not to be changed, not to write code to control it. The problem is more difficult to master, and the master sometimes makes a fool of himself. Remember to eat before the dinner, what is not a dinner?

(3) The operation of what must choose (in fact, any software is the case). When you add code to MX, if you do not choose, you must specify the name, in fact, this is also a choice.

10. Several items of attention

(1) button cannot be covered with input text, dynamic text and input text fields cannot be covered with buttons.

(2) Use Loadmovie when the LEVEL1 and above documents as far as possible with the large stealth button.

(3) Copy the MC instance from one file to another file, copy the frame as much as possible, and not copy the instance directly.

(4) from a file to copy the MC instance to another file, to the target file in the symbol library in the original symbol, loaded into the resource folder, a lot of netizens in this question on the above?

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.