ACTIONSCRIPT3.0 teaches you to access variables in the main scene in a movie clip

Source: Internet
Author: User

In ActionScript2.0, the movie clip accesses the variables in the main scene in a very simple way, just using an absolute path with _root.

However, it is not easy to access the variables in the main scene in the ActionScript3.0 movie clip, and the root error will be used. Here's a very simple way to access the variables in the main scene. Here's how: 1. Define a variable Father:object in the MC (movie clip instance name); 2. Assignment in the home View Code mc.father = this; 3. When you visit a movie clip, you father directly. The variable name is OK.

ACTIONSCRIPT3.0 teaches you to access variables in the main scene in a movie clip

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.