Flash in the MC event parameters detailed _flash as

Source: Internet
Author: User
The events in MC are described below:
Load: This event occurs when the MC is loaded in
Enterframe: This event occurs when the MC is unloaded
MouseDown: This event occurs when the left mouse button is pressed
MouseUp: This event occurs when the left mouse button is released
MouseMove: This event occurs when the mouse is moving
Keydown: This event occurs when the keyboard button is pressed
Keyup: This event occurs when the keyboard button is released
Data: This event occurs when data is received by using the loadvariable or Loadmovie action

MovieClip (object)
In the method of MC object, some standard action of operation MC Target is stipulated. In addition, additional features are provided in addition to the standard actions listed in the Action panel. When you call the method of the MC object, you do not need to call the constructor first, instead, you can use the following syntax to refer directly to the MC's entity name.
Anymovieclip.play ();
Anymovieclip.gotoandplay (3);
MovieClip Object Methods list:
Method description
Attachmovie a section of movie in a binding library.
Duplicatemovieclip copies the specified movie clip.
GetBounds returns the maximum and minimum x, y-coordinate values of movie in the specified coordinate space.
Getbytesloaded returns the number of bytes loaded in the specified MC.
Getbytestotal returns the total number of bytes in the specified MC.
GetURL Execute URL request.
Globaltolocal converts the pointer object from the coordinate system in the main scene to the local coordinate system of the specified MC.
gotoAndPlay jumps to the specified frame in the MC and starts to play the animation.
gotoAndStop jumps to the specified frame in the MC and stops the animation.
HitTest returns True if the scope of the specified MC crosses the range of the target MC.
Loadmovie loads the specified animation into the MC.
Loadvariables load variables from URLs or other locations into the MC.
Localtoglobal converts the pointer object from the local coordinate system of the MC to the coordinate system in the main scene.
NextFrame play the next frame of the MC.
Play the specified MC
Prevframe play the previous frame of the MC.
The removemovieclip will be removed from the timeline by the Duplicatemovieclip action or the MC produced by the Attachmovie method.
STARTDRAG Specifies that an MC is a drag and starts dragging the MC.
Stop stops the current animation from playing.
Stopdrag Stop any MC that is currently being dragged.
Swapdepths the specified MC with the specified depth value of the MC for the exchange of depth values.
Unloadmovie will be deleted with an animated Loadmovie load.
Movieclip.attachmovie
Grammar:
Anymovieclip.attachmovie (Idname, newname, depth);
Parameters:
Idname the name of the movie in the library to bind. The name is the identity name entered in the Linkage Properties dialog box for the element.
NewName is the name of the entity that is bound to the MC and must be unique.
Depth an integer value to specify the depth value of the MC.
Description
method; generates a new entity for the animation in the library and binds the specified anymovieclip. Use Removemovieclip or Unloadmovie actions or methods to delete a bound animation.
Player:
Flash 5 or later version.
Reference:
Removemovieclip
Unloadmovie
Movieclip.removemovieclip
Movieclip.unloadmovie
Movieclip.duplicatemovieclip
Grammar:
Anymovieclip.duplicatemovieclip (newname, depth);
Parameters:
NewName replicates the unique identification used by the MC (that is, the entity name).
Depth The depth value of the duplicated MC.
Description
method to generate a new entity for the specified MC in the animation operation. The resulting MC is always played at the first frame, regardless of which frame the original MC was in when the MC was copied. The variables in the original MC will no longer be made into the newly generated MC. If the original MC is deleted, the MC copied by it will also be deleted. The MC produced by Duplicatemovieclip can be removed using removemovieclip actions or methods.
Player:
Flash 5 or later version
Reference:
Removemovieclip
Movieclip.removemovieclip
Movieclip.getbounds
Grammar:
Anymovieclip.getbounds (Targetcoordinatespace);
Parameters:
Targetcoordinatespace the target path of the coordinate system that is used as the conversion reference point.
Description
method; Returns the x,y coordinate range in the target coordinate system specified by the MC in the parameter. The returned object contains the following properties {xmin, xmax, ymin, ymax}. The Localtoglobal and Globaltolocal methods of MC object can be used to convert the local coordinate system and the main scene coordinate system to each other.
Player:
Flash 5 or later version
Example:
In the following example, use getbounds to obtain the coordinate range of the Mymoviceclip entity in the Home View coordinate system:
Mymovieclip.getbounds (. _root);
Reference:
Movieclip.globaltolocal
Movieclip.localtoglobal
movieclip.getbytesloaded
Grammar:
Anymovieclip.getbytesloaded ();
Parameters:
No
Description
method; Returns the number of bytes that the specified MC object is loaded in. Because the internal MC is automatically loaded, the return value of this method is the same as the Movieclip.getbytestotal return value when the MC object is to specify an internal MC. This method is especially useful for loading animations, which you can use to compare getbytesloaded with getbytestotal to know the percentage of external animations loaded.
Player:
Flash 5 or later version
Movieclip.getbytestotal
Grammar:
Anymovieclip.getbytestotal ();
Parameters:
No
Description
method; Returns the total number of bytes in the specified MC object. The return value is the size of the SWF file for the external MC (active painting or the MC that is loaded into a target MC or layer).
Player:
Flash 5 or later version.
Movieclip.geturl
Grammar:
Anymovieclip.geturl (URL [, window, variables]]);
Parameters:
The URL request action to be executed by the URL.
Window Optional parameter that specifies the name of the Windows or frame in which the URL response is located. You can also use the following target name: _self Use the current frame in the current window, _blank Specify a new window, _parent specify the parent window for the current frame, _top Specify the top-level window for the current window.
Variables an optional parameter that specifies the method of passing the variable, ignoring the argument if it is not passed, otherwise the specified variable is passed by a get or post. The Get method adds a variable to the end of the URL, usually when the variable is low. POST passes a variable to an HTTP header separated by a variable, which is usually used when passing variables are longer.
Description
method, and executes a specific URL response in a specific window. The Geturl method can also be used to pass a variable to another application defined by the URL, via a Get or post method.
Player:
Flash 5 or later version
Movieclip.globaltolocal
Grammar:
Anymovieclip.globaltolocal (point);
Parameters:
Point A object that is a property of the x,y coordinates (this is called the pointer object for the moment), which is obtained by generating a new generic object.
Description
method to convert the pointer object from the main scene coordinate system to the local coordinate system of the MC.
Player:
Flash 5 or later version
Example:
The following example converts a pointer object that contains the x,y coordinates of the main scene into the local coordinates in the MC.
Onclipevent (MouseMove) {
Point = new Object ();
Point.x = _root._xmouse;
Point.y = _root._ymouse;
Globaltolocal (point);
_root.out = _xmouse + "= =" + _ymouse;
_root.out2 = point.x + "= =" + Point.y;
Updateafterevent ();
}
Reference:
Movieclip.localtoglobal
Movieclip.getbounds
Movieclip.gotoandplay
Grammar:
Anymovieclip.gotoandplay (frame);
Parameters:
The frame position where the frame playhead will be set (the frame position to begin playing).
Description
method, starting the animation at the specified number of frames.
Player:
Flash 5 or later version.
Movieclip.gotoandstop
Grammar:
Anymovieclip.gotoandstop (frame);
Parameters:
The frame position to which the frame playhead is to be moved.
Description
method, jumps to the specified frame, and stops the animation from playing.
Player:
Flash 5 or later version.
Movieclip.hittest
Grammar:
Anymovieclip.hittest (x, y, Shapeflag);
Anymovieclip.hittest (target);
Parameters:
x coordinates of the click area in the Home view.
Y coordinates of the click area in the Home view.
X,y coordinates are defined in the coordinate system of the main scene.
Target Anymovieclip the target MC to which this entity is to intersect. This goal is usually shown as a button or a text box.
Shapeflag is a Boolean value that, when it is a (true) value, is judged according to the entity's shape, and when it is (false), it is simply judged by the entity's scope box (that is, by the top and bottom of the MC). This parameter is used only in the first form.
Description
method to determine whether the specified Anymovieclip is interleaved with another MC or a point specified in x.y coordinates.
The first usage specifies that the shape or scope box of the entity (through Shapeflag settings) is compared to the point of the x,y coordinate. If Shapflag is true, the method returns the value TRUE if it is compared using the actual shape in the entity, when any point in the entity passes through the point (x,y). This is useful when judging the specified click area (hot Zone) of the MC.
The second usage determines whether the bounds of the specified entity and target intersect, and the intersection of any of them will cause the return value to be true.
Player:
Flash 5 or later version
Example:
The following example determines whether your MC entity YOURMC passes through dots (100,200):
if (yourmc.hittest, false); (100,200) The coordinates of the points for you to judge
One of the last parameters: false to determine whether the YOURMC range box (up or down) passes through (100,200) points
True to determine whether the actual shape of the YOURMC passes through the point of (100,200)
The following example uses the HitTest and X_mouse and Y_mouse parameters to determine whether the mouse is in the range of the target MC:
if (HitTest (_root._xmouse, _root._ymouse, false)); (Please put it in the Onclipevent (enterframe) event of MC, otherwise do not see the effect)
The following example determines whether the MC entity ball is interleaved with another MC entity square:
if (_root.ball.hittest (_root.square)) {
Trace ("Ball intersects Square");
}
Reference:
Movieclip.localtoglobal
Movieclip.globaltolocal
Movieclip.getbounds
Movieclip.loadmovie
Grammar:
Anymovieclip.loadmovie (URL [, variables]);
Parameters:
URL to the absolute or relative URL path of the SWF file to be loaded. The relative path must be connected to the SWF file. The URL path must be in the same child domain as the path where the current animation is located. When using the Flash Player or using Test-mode mode in Flash for direct testing, all SWF files must be placed in the same directory, and the file name cannot contain the folder name and the drive name.
Variables optional parameter; Specifies the method used by the associated variable when loading the animation. This parameter must be a string "get" or "POST". If no variables are associated, this argument is ignored. Otherwise, the method that specifies the load variable is either get or post. The Get method adds a variable to the end of the URL, usually when the variable is low. POST passes a variable to an HTTP header separated by a variable, which is usually used when passing variables are longer.
Description
method to play the attached animation without closing the Flash player. Typically, the Flash Player plays a single animation (SWF file). The Loadmovie method allows you to play multiple animations at once or jump between animations without any HTML request.
Use the Unloadmovie action to delete animations that have Loadmovie actions loaded.
Use the Loadvariables method to maintain the current animation while updating some variable values to the new values.
Player:
Flash 5 or later version
Reference:
Movieclip.loadvariables
Movieclip.unloadmovie
Movieclip.loadvariables
Grammar:
Anymovieclip.loadvariables (URL, variables);
Parameters:
The absolute or relative URL path of the URL external file. The host name of the URL must be in the child domain where the current animation resides.
Variables The method that returns the variable. The Get method adds a variable to the end of the URL, usually when the variable is low. POST passes a variable to an HTTP header separated by a variable, which is usually used when passing variables are longer.
Description
method, reading data from an external file, setting an animation or MC variable. This external file can be a text file produced by CGI, ASP, and PHP programs, and can contain any number of variables.
This method can be used to update the variable value of the current animation to a new value.
This method requires that the text connected with the URL must be a standard MIME-formatted text:
application/x-www-urlformencoded (CGI program format).
Player:
Flash 5 or later version
Reference:
Movieclip.loadmovie
Movieclip.localtoglobal
Grammar:
Anymovieclip.localtoglobal (point);
Parameters:
Point A object that is a property of the x,y coordinates (this is called the pointer object for the moment), which is obtained by generating a new generic object.
Description
method to convert the pointer object from the local coordinate system of the MC to the main scene coordinate system.
Player:
Flash 5 or later version
Example:
The following example converts a pointer object from the X,Y coordinates of the MC Local to the main scene coordinate system. The local x,y coordinates are obtained using xmouse and Ymouse.
Onclipevent (MouseMove) {
Point = new Object ();
Point.x = _xmouse;
Point.y = _ymouse;
_ROOT.OUT3 = point.x + "= =" + Point.y;
_root.out = _root._xmouse + "= =" + _root._ymouse;
Localtoglobal (point);
_root.out2 = point.x + "= =" + Point.y;
Updateafterevent ();
}
Reference:
Movieclip.globaltolocal
Movieclip.nextframe
Grammar:
Anymovieclip.nextframe ();
Parameters:
No
Description
method; The MC's playhead is set to the next frame.
Player:
Flash 5 or later version
Movieclip.play
Grammar:
Anymovieclip.play ();
Parameters:
No
Description
Method of dialing and placing MC.
Player:
Flash 5 or later version.
Movieclip.prevframe
Grammar:
Anymovieclip.prevframe ();
Parameters:
No
Description
method; Sets the playhead to the previous frame and stops playing.
Player:
Flash 5 or later version.
Movieclip.removemovieclip
Grammar:
Anymovieclip.removemovieclip ();
Parameters:
No
Description
Method: The MC entity is deleted by Duplicatemoviceclip action or by the Attachmovie method of MC object.
Player:
Flash 5 or later version.
Reference:
Movieclip.loadmovie
Movieclip.attachmovie
Movieclip.startdrag
Grammar:
Anymovieclip.startdrag ([Lock, left, right, top, bottom]);
Parameters:
Lock a Boolean value, when (true), the dragged MC will be locked in the center of the mouse, and when (false), the drag MC will be locked at the user's first click of the MC's location. This parameter is an optional parameter.
Left, top, right, bottom a parameter that restricts the bounds of the towed MC constraint, which are optional parameters.
Description
method, allowing the user to drag the specified MC. This MC will remain in a drag state until the Stopdrag method is executed, or the other MC is set to be dragged. At the same time, only one MC can be dragged.
Player:
Flash 5 or later version
Reference:
Movieclip.stopdrag
_droptarget
Movieclip.stop
Grammar:
Anymovieclip.stop ();
Parameters:
No
Description
method; Stop the current MC playback.
Player:
Flash 5 or later version.
Movieclip.stopdrag
Grammar:
Anymovieclip.stopdrag ();
Parameters:
No.
Description
method, stopping the StartDrag method that is being executed. When an MC executes the StartDrag method, the MC remains in a drag state until the Stopdrag method is executed, or the other MC is set to a drag state. At the same time, only one MC can be dragged.
Player:
Flash 5 or later version.
Reference:
_droptarget
Movieclip.startdrag
Movieclip.swapdepths
Grammar:
Anymovieclip.swapdepths (depth);
Anymovieclip.swapdepths (target);
Parameters:
Target a MC entity whose depth value is exchanged with the depth value of the entity specified by Anymovieclip. Two entities must have the same parent MC.
depth specifies the depth value to be placed on the anymovieclip.
Description
method to exchange the Z-value or cascade order (depth) between the specified entity and the MC of the specified object or depth. Two entities must have the same parent MC. The effect of the depth value of the swap entity is to place an entity either before or after another entity. When converting the depth, the MC transition stops if the MC is transitioning. (After testing, stop is the current MC transition action, not the internal MC of the Transition action.) )
Player:
Flash 5 or later version
Reference:
_level
Movieclip.unloadmovie
Grammar:
Anymovieclip.unloadmovie ();
Parameters:
No
Description
Method, the MC that will be loaded with Loadmovie or Attachmovie method is deleted.
Player:
Flash 5 or later version
Reference:
Movieclip.loadmovie
Movieclip.attachmovie

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.