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 6361093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:43:54+00:00 2026-05-24T23:43:54+00:00

I have this main (document class) in a Flash project: package { import flash.display.MovieClip;

  • 0

I have this main (document class) in a Flash project:

package  {
    import flash.display.MovieClip;
    import flash.events.Event;
    public class main extends MovieClip {

        public function main() {
            var other=new Other(this);
        }
    }   
}

This one is Other class:

    package  {
        import flash.display.MovieClip;
        import Clippo;

        public class Other extends MovieClip {
            //
            public function Other(ref) {
                //
                var clippo = new Clippo();
                clippo.name="clippo";
                clippo.x=100;
                clippo.y=100;
                //1
                //ref.addChild(clippo);
                //2
                addChild(clippo);
            }
        }
}

Now: if I pass a reference (ref) of the main class to Other and I add clippo as you can see in the first case, I can reference the movieclip clippo from the main (getChildAt(0) is “clippo” from the main). But, is there any way to use the second method (no ref) and do the same from the main class? I can see clippo onstage when Other creates it but I can’t understand where clippo “lives” into the DisplayList.

  • 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-24T23:43:55+00:00Added an answer on May 24, 2026 at 11:43 pm

    I’m not exactly sure what you’re trying to accomplish, but:

    1. You need to add other to the display list if you want to see it or its children.

      public function main()
      {
          var other:Other = new Other(this);
          addChild(other);
      }
      
    2. You can use root instead of passing a reference to the document class. (Once it’s on the display list).

      root.addChild(clippo);
      

      But, it makes more sense to just add it to Other: addChild(clippo)

    3. Where you create DisplayObjects doesn’t affect the display list, only calling addChild does. Calling addChild in the document class, and root.addChild in Other result in the same display list.

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

Sidebar

Related Questions

Suppose I have the following class package { import flash.display.Stage; public class CustomObject {
i have this html menu: <ul id='main'> <li class='active current' id='lighty'> <a href='/'>Lighty</a> <ul>
I have a Main class loading 2 SWF (loader and viewer, also with document
I have the following piece of code: class Student { public: Student(){} void display()
If I have these models: class Sub(EmbeddedDocument): name = StringField() class Main(Document): subs =
I have already set a variable in my document class Main.as. I am now
I have this as Main int[] M ={ 10, 2, 30, 4, 50, 6,
I have this TreeView: Main Node Header=Main Sub Node Header=Sub1 Final Node Header=Item1 Final
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
On my main page I have this jquery code which does an ajax call

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.