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

  • SEARCH
  • Home
  • 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 7591339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:37:40+00:00 2026-05-30T20:37:40+00:00

How to access a display object on the stage in a class which is

  • 0

How to access a display object on the stage in a class which is not a document class?

I am looking for a solution that doesn’t involve passing the stage as a parameter to the class.

One solution i always come across is using “TopLevel.as“. Is it a good method because as far as I have heard using global variables is not recommended because it might cause some problems while working on big projects.

  • 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-05-30T20:37:42+00:00Added an answer on May 30, 2026 at 8:37 pm

    All display objects have a addedToStage event dispatched when they are added to the display list, which gives you a reference to the stage. So you could do something like this:

    // In the constructor
    addEventListener(Event.ADDED_TO_STAGE, onAdded);
    
    // A class level function
    private function onAdded(e:Event):void {
        // get reference from stage, eg:
        // stage.getChildByName("nameHere");
    }
    

    There is no need to use the “Top Level” class, which is relying on global (ie: static) properties.

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

Sidebar

Related Questions

I've created a Display object that contains the header, sidebar and footer: class Display
How do I access the stage in Actionscript 3 in a class which is
I am looking for a method to display virtual rows in an MS Access
I've got an MS-Access app (1/10th MS-Acccess, 9/10ths MS-SQL) that needs to display photographs
I have a singleton class that inherits from sprite so that it can access
How do I access Stage Class properties in Costum Class? Class: package { import
Please help me. When I trying to access http://127.0.0.1:8000/myblog/ It display empty object list.
I'm trying to access a text input that I've already placed on the stage
How can you access and display the row index of a gridview item as
I've created an Access 2007 form that displays, for example, Products from a Product

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.