Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9220969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:28:20+00:00 2026-06-18T03:28:20+00:00

In ActionScript 3, I’ve read that the root variable references an instance of the

  • 0

In ActionScript 3, I’ve read that the root variable references an instance of the Document Class.

Within my document class constructor, a trace(this == root) returns true. Later in the constructor, a constructor of another class is called. This constructor, however, states that root is null. Finally, tracing from an event listener gives me the result that root is [object Stage].

My goal is to have a single instance of a Document Class (in MainGame.as) and to be able to refer to that as (root as MainGame) throughout my ActionScript program. How can I do this?

If it matters, all of my code is in the default package.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:28:22+00:00Added an answer on June 18, 2026 at 3:28 am

    The root propety of a DisplayObject becomes a reference to the Document Class once the DisplayObject is added to the display list. You can continue to use root but be aware that only objects on the display list will work.

    You can read more about root here:

    The root property of the Stage object is the Stage object itself. The root property is set to null for any display object that has not been added to the display list, unless it has been added to a display object container that is off the display list but that is a child of the top-most display object in a loaded SWF file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For Actionscript 2.0 Let's say this page www.example.com/mypage returns some html that I want
In Actionscript... If I Have an XML variable that equals this: var X:XML=XML(<mx:WindowedApplication xmlns:mx=http://www.adobe.com/2006/mxml
I have an actionscript class in my flex app that looks like this: package
Actionscript 3.0 is much more powerful than its previous versions. Does this mean that
I'm new to actionscript and I have noticed that many variable names in actionscript
In Actionscript you can have a variable hold a reference to a class type
In ActionScript 2 and 3, we can access a member variable of a class
In actionscript object class can act as a collection that stores key,value combinations: var
I have a dynamic ActionScript Class that is used to send parameters to a
Flash ActionScript myData = new LoadVars(); myData.onLoad = function() { myText_txt.text = this.myVariable; };

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.