# \_parent problem

**URL:** <https://forum.kirupa.com/t/-parent-problem/182863>\
**Category:** Uncategorized\
**Created:** [March 22, 2006, 12:46am UTC](https://forum.kirupa.com/t/-parent-problem/182863 "2006-03-22T00:46:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![20rr0](https://avatars.discourse-cdn.com/v4/letter/2/ecc23a/32.png) [@20rr0](https://forum.kirupa.com/u/20rr0)\
**Post date:** [March 22, 2006, 12:46am UTC](https://forum.kirupa.com/t/-parent-problem/182863/1 "2006-03-22T00:46:25Z")

</div>

Hi guys,

\_parent problem.

First I make a emptyMovieClip for using it as an container for my buttons.  
Then I attach the movieClip from the library to the container… Everything good so far.  
But now I have 5 buttons. They all have a different intance names.  
If I click one of the buttons it have to make that one active and at the same time it have to see that the other ones are inactive (I thought with parent). But you can’t \_parent in a attached MovieClip…

I hope that you understand what I am trying to explane.  
I attached the test fla. Maybe that makes things more clear. And here is the code.

```auto
function makeContainer(container, newX, newY) {
    var container:MovieClip = this.createEmptyMovieClip(container, this.getNextHighestDepth());
    container._x = newX;
    container._y = newY;
}
//
makeContainer("XContainer", 112, 35);
//
blaArray = new Array("square1", "square2", "square3", "square4", "square5");
//

XContainer.nextButtonX = 0;
for (i=0; i<=blaArray.length; i++) {
    movieNaam = blaArray[i-1];
    button = this.XContainer.attachMovie("mc_square", movieNaam, this.XContainer.buttonCounter);
    button._x = this.XContainer.nextButtonX;
    this.XContainer.nextButtonX += button._width;
    this.XContainer.buttonCounter = i;
    //
    button.iAmDeactive = function() {
        trace(this+" = deactive");
    };
    //button actions
    button.onRollOver = function() {
        this._alpha = 80;
    };
    button.onRollOut = function() {
        this._alpha = 100;
    };
    button.onPress = function() {
        this._alpha = 50;
        this.active == true;
        //trace(this+" = active");
        //Here it should give the function to the other "non"active button
if (!_parent.active) {
        _parent.iAmDeactive();
        }
        
    };
    button.onRelease = function() {
        this._alpha = 100;
    };
    
}

```

Thanks in advance,  
20rr0 :bandit:
