AS3 – Access root from a movie clip

Use like this to access root from a movie clip

MovieClip(root).someThing;

For example suppose you have a text box in root with instance name txtAddress in your root. If you need to set the text of txtAddress from a movie clip the code should be like

MovieClip(root).txtAddress.text = "Some text here."
This entry was posted in ActionScript and tagged , , . Bookmark the permalink.

4 Responses to AS3 – Access root from a movie clip

  1. Abhilash says:

    Thanks a ton buddy

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>