Movieclip enables drag-and-drop and other mobile location Functions

Source: Internet
Author: User

Today, I have implemented the movieclip Moving position function for loading, including the top, bottom, left, right move function, full container function, restore initial position function, and the mouse drag and drop function. However, the mobile location function still has a problem:The zooming of the vertical scroll bar cannot be controlled! (I have not found the correct control object yet)

It took a lot of time to solve the problem of moving the movieclip object by dragging the mouse, mainly because: 1. no drag issues before 2. the selected event is correct, but the internal drag control method is unknown 3. it tries to capture the mouse coordinates in real time through mouse events, so as to continuously change the coordinates of movieclip. (This idea seems to be feasible, but later I created a lot of problems in the process of solving it. This idea makes stopdrag () method implementation in my mouse_up event processing, it occurs that movieclip keeps moving with the mouse, even if you do not click the mouse ).

The method is very simple, that is, through the mouse_down and mouse_up events of the container objects outside the movieclip, respectively, to control the start drag of the container itself (the container object. startdrag () and stop dragging (container object. stopdrag () method. Note: instead of directly dragging movieclip, You need to drag the container outside it. In essence, the uicomponent object has a drag method, and the movieclip does not. In addition, you do not need to change the coordinates of the movieclip object.

CodeIt's easy, just four or five lines. Now we don't need to post code. As long as we do what I said, it will certainly be okay. The drag-and-drop effect map is not obvious. Wait for me to solve the zooming problem of the vertical scroll bar and paste it again.

In addition, the previously mentioned movieclip thumbnail problem is a bit tricky. I have some preliminary ideas and are working on it ......

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.