# Help! accessing mc from another mc

**URL:** <https://forum.kirupa.com/t/help-accessing-mc-from-another-mc/261544>\
**Category:** Uncategorized\
**Created:** [May 28, 2008, 5:54pm UTC](https://forum.kirupa.com/t/help-accessing-mc-from-another-mc/261544 "2008-05-28T17:54:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cloptic](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@cloptic](https://forum.kirupa.com/u/cloptic)\
**Post date:** [May 28, 2008, 5:54pm UTC](https://forum.kirupa.com/t/help-accessing-mc-from-another-mc/261544/1 "2008-05-28T17:54:03Z")

</div>

Hi!  
pretty new to Flash, real new to AS, so please forgive the ignorance.  
Setup: stage holds 2 MC’s one named main\_mc, one named window\_mc.  
main\_mc holds a single MC named button\_mc.  
All AS is in timeline.  
Frame 1 of window\_mc has:

var myLoader:Loader = new Loader();  
addChild(myLoader);

in button\_mc actions:

button\_mc.addEventLister((MouseEvent.CLICK, buttonClick);

function buttonClick (event:MouseEvent):void  
{  
button\_mc.enabled = true;  
event.target.enabled = true;  
MovieClip(???).myloader.load (new URLRequest(event.target.name + “.swf”));

_ **question marks indicate problem area** _

every way I try to access window\_mc through is failing miserably with:

1119: Access of possibly undefined property some through a reference with static type flash.display:DisplayObjectContainer

or a null object error.

HELP!!!

pulling my hair out.

thanx in advance!

---

<div class="post-metadata">

**Author:** ![Alex\_Lexcuk](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alex\_Lexcuk](https://forum.kirupa.com/u/Alex_Lexcuk)\
**Post date:** [May 28, 2008, 7:56pm UTC](https://forum.kirupa.com/t/help-accessing-mc-from-another-mc/261544/2 "2008-05-28T19:56:43Z")

</div>

[http://kind-armadillo.pochta.ru/fla/osc.swf](http://kind-armadillo.pochta.ru/fla/osc.swf)

[http://kind-armadillo.pochta.ru/FlaAC3/RotateSWF.swf](http://kind-armadillo.pochta.ru/FlaAC3/RotateSWF.swf)  
[http://kind-armadillo.pochta.ru/FlaAC3/RotateSWF.rar](http://kind-armadillo.pochta.ru/FlaAC3/RotateSWF.rar)

[http://kind-armadillo.pochta.ru/FlaAC3/curve.swf](http://kind-armadillo.pochta.ru/FlaAC3/curve.swf)

[http://kind-armadillo.pochta.ru/FlaAC3/loadSWF.swf](http://kind-armadillo.pochta.ru/FlaAC3/loadSWF.swf)  
[http://kind-armadillo.pochta.ru/FlaAC3/loadSWF.rar](http://kind-armadillo.pochta.ru/FlaAC3/loadSWF.rar)

---

<div class="post-metadata">

**Author:** ![shaftoe](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@shaftoe](https://forum.kirupa.com/u/shaftoe)\
**Post date:** [May 28, 2008, 8:02pm UTC](https://forum.kirupa.com/t/help-accessing-mc-from-another-mc/261544/3 "2008-05-28T20:02:24Z")

</div>

> [@cloptic;2332486](#):
>
> Frame 1 of window\_mc has:
> 
> var myLoader:Loader = new Loader();  
> addChild(myLoader);

You’re ok so far…

> 

function buttonClick (event:MouseEvent):void  
{  
button\_mc.enabled = true;  
event.target.enabled = true;

These two lines are both setting button\_mc enabled to true, you only need one of them, assuming ‘enabled’ does something special.

> 

MovieClip(???).myloader.load (new URLRequest(event.target.name + “.swf”));  
_ **question marks indicate problem area** _

Remove the MovieClip() from the beginning (also it was declared as ‘myLoader’, not ‘myloader’), the reason you are getting the error is there is no method or property called myLoader in the MovieClip class. Just refer to your declared myLoader directly.

> 

every way I try to access window\_mc through is failing miserably with:

After myLoader has finished loading, to access what is inside it you need to point to myLoader.content

---

<div class="post-metadata">

**Author:** ![cloptic](https://avatars.discourse-cdn.com/v4/letter/c/db5fbb/32.png) [@cloptic](https://forum.kirupa.com/u/cloptic)\
**Post date:** [May 28, 2008, 9:25pm UTC](https://forum.kirupa.com/t/help-accessing-mc-from-another-mc/261544/4 "2008-05-28T21:25:08Z")

</div>

thanx guys, got it working now!
