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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:46:28+00:00 2026-05-26T16:46:28+00:00

Say i have a movieclip named a_Mc ( ClassA ) . I have a

  • 0

Say i have a movieclip named a_Mc ( ClassA ) .

I have a sub-movieclip named b_Mc ( ClassB )


CASE 1: Accessing the sub-movieclip b_Mc which is already present inside the a_Mc movieclip

( Since Flash IDE has “Automatic instance naming” OFF )

ClassA mentions the name of b_Mc as => var b_Mc:MovieClip;

NOTE HERE: That the variable name MUST BE same as the name of the instance on stage.

So i can access it as : trace( a_Mc.b_Mc);


CASE 2: Accessing the sub-movieclip b_Mc after adding it dynamically

var b_Mc:ClassB = new ClassB();
b_Mc.name = "someName" ;
a_Mc.addChild(b_Mc) ;

So i can access it as : trace( a_Mc.getChildByName("someName"));


I wanna understand, why is there such implementation difference when on the contrary things must be similar. How exactly flash player manages “existing instance names”, “dynamically added instance names” and “variable names used in related classes to represent those instance names” ?

Thanks
Vishwas.

  • 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-26T16:46:29+00:00Added an answer on May 26, 2026 at 4:46 pm

    You are actually doing two different things there.

    In case 1 b_Mc is a variable contained within Class A.
    In case 2 b_Mc is a child of the a_Mc MovieClip’s display list.

    So in case 2, you can access b_Mc by just doing trace(b_Mc);. You don’t have to go through a_Mc since the variable was created outside of the class.

    There is a difference between something being a display list child (case 2) and being a member variable of an object (case 1).

    If you wanted to dynamically create the sub-movieclip you could do:

    var newB:ClassB = new ClassB();
    a_Mc.b_Mc = newB;
    

    There you’re assigning the new clip to the b_Mc variable within Class A.
    Then you could access it the same as in case 1:

    trace(a_Mc.b_Mc);
    

    You could also create the b_Mc within Class A and assign it to the b_Mc variable directly:

    // inside Class A
    b_Mc = new ClassB();
    
    // outside Class A
    trace(a_Mc.b_Mc);
    

    Note that all of these are independent of whether or not b_Mc is a child of A’s display list, or whether or not is on the display list at all.

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

Sidebar

Related Questions

Lest just say i have a movieClip A which contains movieClips B1,B2,B3,B4,B5 I write
Let's say I have a defined ClassA. ClassB extends ClassA and there's a Movie
let's say I have two shapes wrapped in Movieclip container. How can I detect
Let's say I have a resource file which exports mc1 with 4 frames in
Say I have a model Person for which there is a PersonIndex class in
I have a MovieClip containing an image. The image can be dragged around inside
Lets say we have a movieclip Enemy in the Flash library and a class
Say I have a movieclip called mcLoader and within it I have some loaded
Lets say I have a MovieClip called Box, and String is actually 'box' just
So i have this sprite that is say arbitrarily 100 x 100 which is

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.