# Access variable in parent from loaded SWF

**URL:** <https://forum.kirupa.com/t/access-variable-in-parent-from-loaded-swf/262751>\
**Category:** flash\
**Created:** [June 9, 2008, 5:22pm UTC](https://forum.kirupa.com/t/access-variable-in-parent-from-loaded-swf/262751 "2008-06-09T17:22:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![veniceflasher](https://avatars.discourse-cdn.com/v4/letter/v/f19dbf/32.png) [@veniceflasher](https://forum.kirupa.com/u/veniceflasher)\
**Post date:** [June 9, 2008, 5:22pm UTC](https://forum.kirupa.com/t/access-variable-in-parent-from-loaded-swf/262751/1 "2008-06-09T17:22:38Z")

</div>

Hey people,

I have a mystery error going on when I try and access a variable in my main movie from a loaded SWF. As far as I can tell from most feedback I’ve gotten I should be able to do it with  
MovieClip(parent.parent).varName. I’m simply trying to set a boolean to true to indicate that a button has been clicked. When the button is clicked I get the error - Error #1009: Cannot access a property or method of a null object reference.

What am I doing wrong?

Here’s the code:

function but\_1\_down(event:MouseEvent):void{  
workChoice = 1;  
var nextF\_AplhaTween\_1:Tween = new Tween(nextFrameButt, “alpha”, Regular.easeIn, 1, 0, 1, true);  
gotoAndStop(2);  
MovieClip(parent.parent).thumbClicked = true;

```
}
```
