Understand bubble events in ActionScript 3.0

Source: Internet
Author: User

The understanding of bubble events involves three phases:

1. In the capture phase, the eventphase attribute value is 1.

2. Attribute Value 2 of eventphase in the target stage

3. In the bubble stage, the eventphase attribute value is 3.

The above is described in the actionscript3 Palace Road by heiyu. Let's take a look at the following example:

For example, if you click the last 3rd containers, the event flow process is as follows:

If you click the event in container C to stop the click event, when you drag the container, the container and

The other containers above will be moved. The containers below the clicked container will not move, because in the event of the clicked container,

The bubble has stopped, that is, the tendency to bubble to the stage has also stopped.ProgramIn E. stoppropagation (), is the key to stopping bubble

.

If you do not stop the Click Event bubble in the event of container C, the click event will bubble to the container closest to the stage.

Is the bottom big container. Of course, when you drag a large container, it is to drag the large container, and the other containers on the large container will also

Move.

 

Source code: Http://files.cnblogs.com/bigbigdotnet/event.rar

Related Article

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.