• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to get the instance name of parent movieclip instance name

Participant ,
Jul 04, 2012 Jul 04, 2012

Copy link to clipboard

Copied

How to get the parent movieclip from child movieclip

I have used MovieClip(parent.parent).When i click the child moviclip it is showing me null value.

TOPICS
ActionScript

Views

1.7K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 04, 2012 Jul 04, 2012

Copy link to clipboard

Copied

To get the parent you would use MovieClip(parent).  You should show the code relevant to your posting and explain the pieces involved.

You should also explain what getting the instance name has to do with the code you show and the description of the problem you provided. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 04, 2012 Jul 04, 2012

Copy link to clipboard

Copied

I have one movieclip in library. Inside that mc i have created three movieclip.By using for loop i have created 5 set of movieclip on stage.

for (var i:int=1; i<(len+1); i++) {

myMovieClip = new qmc();

        if (i==1) {

            var yval:int=stage.stageHeight/3;

            //trace(yval+"==yval");

        } else {

            yval=yval+myMovieClip.height+5;

        }

        myMovieClip.x=stage.stageWidth/10;

        myMovieClip.y=yval+10;

       addChild(myMovieClip);

}

The output will come like this

when i click the first row of  any radio buttons i want to get the moviclip of the parent name or id value of the parent moviclip

i have written the code like this

myMovieClip.name="mc"+i

        myMovieClip.id=i

When i click the radio button am not able to get the parent name

it is showing null

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 04, 2012 Jul 04, 2012

Copy link to clipboard

Copied

I don't know what the missing image might have done to help your explanation, but without it I am definitely not able to follow what you describe.  You start off talking about movieclips inside movieclips and then you talk about a row of radio buttons.

What is the relationship of the radio buttons to the movieclips? What is the code for the radio buttons that you say isn't working?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 04, 2012 Jul 04, 2012

Copy link to clipboard

Copied

Sorry that image was missed i am not able to insert the image.The thing is when i child movieclip i want to access the parent moviclip of id value.

Thats all.The moviclip is in libray.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 05, 2012 Jul 05, 2012

Copy link to clipboard

Copied

You still haven't explained what I asked about.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 16, 2012 Jul 16, 2012

Copy link to clipboard

Copied

LATEST

I got the solution for that

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines