Detailed use of this in Flash action

Source: Internet
Author: User
Tags reference
Detailed listening to a lot of experts say, less absolute, more use relative path, we pay attention to observe, master of the program this more, and _root relatively few, probably learned comrade is not very profound know the use of this, (including me,)

There is a phrase in Help that refers to the timeline that on contains the button in an event-handling function action that is attached to the button this . Refers to the timeline of this the movie clip itself, in the Onclipevent () event handler action that is attached to the movie clip. "

So note that this is different from what is written in the MC, and the above sentence is accurately explained.

What if it's written on a frame?

1, if it is not a handle, then is the current timeline of the reference, if it is with the timeline, then it is the reference to the timeline. If it is the timeline in a stage case, then the timeline for that case.

2, if it is in the handle, see what is the handle

_root.mc.onpress=function{
This .......
}

The purpose of this is to refer to the this timeline of the movie clip itself in the Onclipevent () event handler action attached to the movie clip

if

_root.button.onpress=function () {
This
}

It acts as a reference to the timeline that contains the button in an on event this handler action attached to the button



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.