Principles of Flash ActionScript Programming

Source: Internet
Author: User
When learning flash actionscript programming, especially for beginners, pay more attention to the following Flash ActionScript ProgrammingTo learn Flash ActionScript ProgrammingVery helpful.

1. FamiliarFlash ActionScript ProgrammingThree ways to add actions

Add frame, MC, And button. Use the play, stop, and goto commands to practice repeatedly. Do not use too many commands to get dizzy medicine for yourself. Use instances for training. Do not leave them empty.

2. familiar with how to add actions to buttons and MC.

3. LearningFlash ActionScript ProgrammingThe most basic and important thing-path description

(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, ......]

It may be helpful for you to practice such an instance: place a song you like to listen to in a MC at will, and add actions on a MC or button to control it at will, if you want to stop it, you can stop it.

4. UnderstandFlash ActionScript ProgrammingCode execution sequence

The layer is executed from bottom up by default.

Level is executed from bottom up

Frames are executed in the actual playing order.

The code itself is executed from the last line

5. UnderstandFlash ActionScript ProgrammingTwo Coordinate Systems

Coordinates in the scenario. The O point is in the upper left corner, and the Y axis is down to increase X to the right.

The coordinates of the component. The O point is in the center of the component, and the Y axis is down to increase X to the right.

6. UnderstandingFlash ActionScript ProgrammingThree types of text fields

Static style domain: the same as the text tool of the typographical software.

Dynamic text fields and input text fields: they are actually two variables, but only visible variables.

7. Learn moreFlash ActionScript ProgrammingGOTO statement

The prevframe () jumps to and stops at the previous frame.

Nextframe () jumps to and stops the next frame.

Prevscene () jumps to and stops 1st frames in the previous scenario.

Nextscene () jumps to and stops 1st frames in the next scene.

Gotoandplay ([scene,] frame)

Jump to the frame of the scene (indicating the current scene is omitted) and play the video.

Gotoandstop ([scene,] frame)

Jump to the frame of the scene scenario (indicating the current scenario is omitted) and stop.

8. Learn moreFlash ActionScript ProgrammingVarious modifiable attributes of MC

_ X relative X coordinate of the center (pixel unit)

_ Y coordinate of the relative y coordinate of the center (pixel unit)

_ XScale horizontal scaling ratio, initially 100

_ Yscale vertical scaling ratio, initially 100

_ Rotation relative rotation angle (degree Unit)

_ Width relative display width (pixel unit)

_ Height relative display height (pixel unit)

_ Alpha display transparency (0 ~ 100)

_ Visvisible

_ Focusrect: whether to display the focus box

9,Flash ActionScript ProgrammingThree major disciplines

(1) You must use an English input method when writing code.

(2) the attributes of MC that are not loaded cannot be changed, and you cannot write code to control them. This problem is hard to grasp, and experts sometimes get confused. Remember, if you have something to eat first, you can treat the guests?

(3) what must be selected for operations (in fact, this is true for any software ). When adding code in MX, you must specify the name if you do not select it. In fact, this is also an option.

10. LastFlash ActionScript ProgrammingSeveral Notes

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

(2) When loadmovie is used, use as few large invisible buttons as possible for files level1 and above.

(3) When copying an MC instance from a file to another file, try to copy the frame instead of directly copying the instance.

(4) When copying a MC instance from a file to another file, you must first put the original symbols in the symbol library in the target file into the resource folder. Many netizens have taken the lead on this issue.

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.