# Accessing a movieclip from within a movieclip

**URL:** https://forum.kirupa.com/t/accessing-a-movieclip-from-within-a-movieclip/259972
**Category:** flash
**Created:** [May 11, 2008, 4:04am UTC](https://forum.kirupa.com/t/accessing-a-movieclip-from-within-a-movieclip/259972 "2008-05-11T04:04:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![phillyrob](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@phillyrob](https://forum.kirupa.com/u/phillyrob)
#### Post date: [May 11, 2008, 4:04am UTC](https://forum.kirupa.com/t/accessing-a-movieclip-from-within-a-movieclip/259972/1 "2008-05-11T04:04:11Z")

</div>

I am using actionscript 3.0 and am having trouble accessing a movie clip on the root from a movieclip that is embedded in another movieclip. Basically I have animated symbols that are embedded inside movieclip A. All those symbols have an alpha = 0. On the root I have movieclip B. When I rollover movieclip B (called nineOval) I want it to react (which it does), but I also want to change the alpha of the embedded movieclip A to = 1 and then back to =0 on rollout. Here is the code below.  
nineOval is on the root, and tank, jet2, missle, ect are embedded inside a movieclipA I called jet. When I rollover nineOval, nineOval should move outward, some text that is on the root should vanish, and the tank and jet2’s alpha should = 1, and then nineoval should move back on rollout and alpha on tank should = 0 and the text on the root should show again. This is not happening. NineOval moves as it should, but I never see the jet or any other armament, I just see the tank, but it doesn’t move at all, as it suppose to animate across the screen per the motion tween I created . On rollover, I get this error message: TypeError: Error #1009: Cannot access a property or method of a null object reference. at ball5\_fla::jet\_18/onRolloverNine(). All my code in place on the inner or child movieclip or inside movieclipA.

I am lost .

Here is my code:

MovieClip(this.parent).nineOval.addEventListener(M ouseEvent.ROLL\_OVER, onRolloverNine);  
MovieClip(this.parent).nineOval.addEventListener(M ouseEvent.ROLL\_OUT, onRolloutNine);

jet2\_mc.alpha = 0;  
tank.alpha = 0;  
missle.alpha = 0;  
explosion.alpha = 0;  
afburn.alpha = 0;

function onRolloverNine(event:MouseEvent):void  
{

MovieClip(this.parent).rmr.alpha = 0;  
MovieClip(this.parent).ovMess.alpha = 0;  
MovieClip(this.parent).nineOval.x -= 30;

jet2\_mc.alpha = 1;  
tank.alpha = 1;  
missle.alpha = 1;  
explosion.alpha = 1;  
afburn.alpha = 1;

}  
function onRolloutNine(event:MouseEvent):void  
{

jet2\_mc.alpha = 0;  
tank.alpha = 0;  
missle.alpha = 0;  
explosion.alpha = 0;  
afburn.alpha = 0;

MovieClip(this.parent).rmr.alpha = 1;  
MovieClip(this.parent).nineOval.x += 30;  
MovieClip(this.parent).ovMess.alpha = 1;

}  
MovieClip(this.parent).nineOval.buttonMode = true;

---

<div class="post-metadata">

### Author: ![gggmork](https://avatars.discourse-cdn.com/v4/letter/g/34f0e0/32.png) [@gggmork](https://forum.kirupa.com/u/gggmork)
#### Post date: [May 11, 2008, 10:21am UTC](https://forum.kirupa.com/t/accessing-a-movieclip-from-within-a-movieclip/259972/2 "2008-05-11T10:21:00Z")

</div>

Shouldn’t M ouseEvent have no space? Otherwise I have no clue.

---

<div class="post-metadata">

### Author: ![kitsunegari](https://avatars.discourse-cdn.com/v4/letter/k/eb8c5e/32.png) [@kitsunegari](https://forum.kirupa.com/u/kitsunegari)
#### Post date: [May 11, 2008, 2:05pm UTC](https://forum.kirupa.com/t/accessing-a-movieclip-from-within-a-movieclip/259972/3 "2008-05-11T14:05:39Z")

</div>

Try **Object(this.parent).nestedmovieclip**

---

<div class="post-metadata">

### Author: ![phillyrob](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@phillyrob](https://forum.kirupa.com/u/phillyrob)
#### Post date: [May 11, 2008, 3:37pm UTC](https://forum.kirupa.com/t/accessing-a-movieclip-from-within-a-movieclip/259972/4 "2008-05-11T15:37:36Z")

</div>

> [@gggmork;2324605](#):
>
> Shouldn’t M ouseEvent have no space? Otherwise I have no clue.

true that just happened, but thanks

---

<div class="post-metadata">

### Author: ![phillyrob](https://avatars.discourse-cdn.com/v4/letter/p/ecd19e/32.png) [@phillyrob](https://forum.kirupa.com/u/phillyrob)
#### Post date: [May 11, 2008, 3:38pm UTC](https://forum.kirupa.com/t/accessing-a-movieclip-from-within-a-movieclip/259972/5 "2008-05-11T15:38:09Z")

</div>

> [@kitsunegari;2324647](#):
>
> Try **Object(this.parent).nestedmovieclip**

I’ll try it. Thanks for replying.
