Movie clip referred to as MC, in Flash, MC is a very important part of the flexible and reasonable use of the MC, can make your flash animation more exciting, more dynamic! In Flash 5, the MC gives the impression of being an object in the C + + language, it can define its own "private" variable, define its own function, and it can respond to events and handle it, and the MC can pass messages, control and sync with each other, The definition of an MC can be copied into a number of the same characteristics of the MC, although the MC can not be inherited, but I think that the MC called animation object is not too much. The production of MC has been discussed in detail in the previous chapters, in this section we mainly introduce some functions and objects that are related to MC in Flash.
Functions related to move clip and their general form
Duplicatemovieclip (<target>,<new name>,<depth>)
Copy an existing MC, where the target parameter is the name of the existing MC, new name is the name of the MC that is copied, depth is the depth of the new MC, it is worth noting that each MC depth can not be the same, otherwise it will cause confusion, Depth large MC will cover depth small MC.
Removemovieclip (<target>)
Delete a copy of the MC, where target is copied out of the MC's name. Non-duplicated MC can not be removed. Deletion means erasing both from memory and from the display screen. This action can only be used with duplicatemovieclip pairing.
Loadmovie (<url>,<level|target>[, "Get" | " POST "])
Loading an MC from a URL address is unknown.
Unloadmovie (<level|target>)
Uninstall an already loaded MC, it can only match with Loadmovie.
StartDrag (<target>[,true| False][,left,top,right,bottom])
Start dragging a mc,target as the name of the MC, and the second parameter indicates whether you want the digital pointer to be set to the center of the MC, left,top,right,bottom four parameters means that the MC can only be dragged within the box defined by the two coordinates. These four parameters can be either a numeric constant or an arithmetic expression.
Stopdrag ()
Stop the mouse on the MC drag.
Onclipevent (< events >)
MC Event Response statement. Take a look at the introduction in the previous section.
Swapdepths (<target>,<target>)
Exchange two MC depth value, this statement is Flash 5 new statements, the control between the MC more convenient.
Telltarget (<target>)
This is a very useful statement. It is used for the mutual control and coordination between MC. For example, an MC can tell another MC when to jump to which frame, an MC can also control when to load another MC, when to show it, when to uninstall it and so on. Reasonable use of telltarget statements, you can make your animation more ornamental.
Movie Clip Object
Flash 5 provides a movie clip object, and the first 6 functions mentioned above have been redefined in this object, and they can completely replace the previous 6 functions. The Movie clip object is defined as follows:
Attachmovie (<idname>,<new name>,<depth>)
Bind a movie, create a library of the MC entity, where the idname is the name of the MC in the library, new name is the name of the newly generated MC, depth for depth. Like a constructor function.
Duplicatemovieclip (<new name>,<depth>)
Copy the current MC for the new MC, the significance of the parameters ibid.
GetURL (<url>,<window>,<method>)
Causes the browser to browse to the specified page. Flash 5 has provided a separate Geturl function, do not know what is the special meaning of encapsulation to here?? Refer to the description of the Geturl function for the meaning of the parameter.
gotoAndPlay (<frame>)
Jumps to the specified frame and plays. The frame parameter can be a numeric constant, a string constant, or an arithmetic expression.
gotoAndStop (<frame>)
Jumps to the specified frame and stops playing. The frame parameter can be a numeric constant, a string constant, or an arithmetic expression.
Loadmovie (<url>,<method>)
Introduce an external movie to the specified layer. The URL is a Web address, and method can be empty, get,post one of three.
Loadvariables (<url>,<method>)
The Web server specified from the URL address introduces an external variable value. Parameter interpretation Ibid.
NextFrame ()
Equivalent to gotoAndStop (Next frame).
Play ()
Starts playing the current MC from the current frame.
Prevframe ()
Equivalent to gotoAndStop (previous frame).
Removemovieclip ()
Deletes the current MC, and the MC is created with the Duplicatemovieclip function.
StartDrag (<true| false>,<left>,<top>,<right>,<bottom>)
Start dragging the current MC. The first Boolean parameter indicates whether the mouse is locked in the center of the current MC, and the Left,top,right,bottom four parameters define a rectangle, and the MC can only be dragged within this rectangular range.
Stop ()
Stops the current MC from playing.
Stopdrag ()
Stop dragging the current MC.
Unloadmovie ()
Uninstalls the current movie, and the current movie must be loaded by Loadmovie.
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.