Frequently-used technology important ActionScript code control

Source: Internet
Author: User

  Ii. Common Technologies

  1. Important ActionScript code control

This is the key to implementing all Flash websites. In particular, Flash MX has added many powerful functions. For more information, see other materials, here we will only introduce some of the most important ActionScript functions required to create a full Flash website.

LoadMovieNum ("url", level [, variables])

LoadMovie ("url", level/target [, variables])

Function Description:
  Load the SWF or JPEG file while playing the originally loaded video.
Parameter description:  
Url The absolute or relative URL of the SWF or JPEG file to be loaded cannot contain the folder or disk drive description.
Level Load the swf file to Movie in the form of layers. If the file is loaded to layer 0, the loaded swf file replaces the currently played Movie ,. 2 to 1.
Target The available path picker obtains and replaces the target MC. The loaded movie will have attributes such as the position, size, and Rotation Angle of the target MC. (It is easier for a person to control the position of .swf when using target)
Variables Optional parameter: Specifies the HTTP method (GET/POST) used to send the variable. If not, this parameter is omitted.

  Level:Flash allows multiple SWF files to run at the same time. Once a SWF file is loaded by Flash, it occupies a "level". The default value is _ Flash0 or _ Level0, then, the Movie is placed in level0 --- level16000 in order. The first SWF file to be loaded is _ Flash0 or _ Level0, and the second file to be loaded to the first layer is _ Flash1 or _ Level1. Note that the previously loaded file does not exit. Otherwise, the first SWF file is washed out and the first file is also exited from the memory.

  Note:If you Load the external Movie to the Leve0 layer or Level0, the original Movie will be temporarily replaced, and you have to Load it again when you need to re-use it. That is to say, A Level can only have one Movie at a time. When using LoadMovie and UnLoadMovie, you must pay special attention to the relationship between levels. Otherwise, when you want to play only one Movie at a time and Unload the previous Movie, there will be unnecessary troubles.

UnloadMovieNum (level)

UnloadMovie [Num] (level/"target ")

Function Description: Delete a video from Flash Player.
Parameter description: Same as above

LoadVariables ("url", level/"target" [, variables])

Function Description:
  Reads data from external files (such as text files, or text generated by CGI scripts, Active Server Page (ASP), PHP, or Perl scripts, set the value of the variable in the Flash Player level or the target video clip.
Parameter description:  
Url Absolute or relative URL of the variable location
Level Specifies the integer at the level of which the Flash Player receives these variables.
Target Point to the target path of the video clip that receives the loaded variable.
Variables Optional parameter: Specifies the HTTP method (GET/POST) used to send the variable. If not, this parameter is omitted.

GotoAndPlay (scene, frame)

Function Description:
  Go to the specified frame in the specified scenario and start playing from the frame. If no scenario is specified, the playback header is forwarded to the specified frame in the current scenario.
Parameter description:  
Scene The name of the scenario to be transferred.
Frame The number or tag of the frame to be transferred.

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.