Flash as3.0 Mouse event mouse_move, Mouse_down

Source: Internet
Author: User

Flash Mouse_over, Mouse_move, Mouse_down, Mouse_up, Mouse_out, Mouse_wheel and Mouse_leave

Flash.events.MouseEvent class, the last Mouse_leave is from Flash.events.Event, in the import class package must pay attention to this problem, because I spent a very long time debugging at this point, we have to find the problem.

Mouse_over-triggered when the mouse moves over the target object, which can be used to simulate the MOUSE over effect of the button;

Mouse_move-triggers when the mouse moves over the target object, primarily for judgment. For example, in the case of drag-and-drop instances, the instance is within the allowable range, if it is exceeded, immediately stop dragging or reset the coordinates of the instance;

Mouse_down-the mouse is triggered when it is pressed above the target object. Note that only when the left mouse button is pressed, the right button and the scroll wheel are not triggered. When the left mouse button is pressed outside the target object and moved to the target object, it is not triggered;

MOUSE_UP-Triggers when the mouse is released above the target object. Note that only when the left mouse button is released, the right key and the scroll wheel are not triggered. When you press the left mouse button over the target object and then move outside the target object, it is not triggered. However, when you press the left mouse button outside the target object and move to the target object, it triggers.

Triggers when the mouse_out-mouse moves outside the target object.

Mouse_wheel-triggers when the mouse rotates the wheel over the target object.

Mouse_leave-Triggers (Stage.addeventlistener (event.mouse_leave,leavehandler);) when the cursor leaves the stage. After using a custom mouse, when the mouse leaves the stage, triggering Mouse_leave event, and then can hide the custom mouse, avoid still stay on stage.

2 Mousechildren. When a child instance is included in the target object, the mouse behavior is induced by the substring, not by the target object. If Cursor.mouseenabled=false is used; The target object can be used for more mouse behavior.

3 mouseenabled. When an instance overlaps, the instance above the display list is always more prioritized than the instance below to induce mouse behavior. Use Cursor.mouseenabled=false when you want the example below to induce mouse behavior; Can. This is often used to customize the mouse to remove the custom mouse behavior interference, because the custom mouse is always under the mouse, other instances can no longer sense the mouse changes.

In addition, perhaps Double_click should also be counted as mouse events, but to use it, you must first let

Doubleclickenabled=true:
var bg:sprite=new Sprite ();
Bg.doubleclickenabled=true;
Bg.addeventlistener (Mouseevent.double_click,clickhandler);

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.