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.
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.
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
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?
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.
Copy link to clipboard
Copied
You still haven't explained what I asked about.
Copy link to clipboard
Copied
I got the solution for that