# Weird variable referencing problem

**URL:** <https://forum.kirupa.com/t/weird-variable-referencing-problem/151657>\
**Category:** flash\
**Created:** [June 17, 2005, 2:33am UTC](https://forum.kirupa.com/t/weird-variable-referencing-problem/151657 "2005-06-17T02:33:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mindfriction](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mindfriction/32/172_2.png) [@mindfriction](https://forum.kirupa.com/u/mindfriction)\
**Post date:** [June 17, 2005, 2:33am UTC](https://forum.kirupa.com/t/weird-variable-referencing-problem/151657/1 "2005-06-17T02:33:48Z")

</div>

Hi guys,

Just a quick question re referencing problem. I couldn’t work out why my entire movie was disappearing and i’ve found the source of the problem in this snippet (below). It seems this.\_visible is referencing root and not the soundControl\_mc as expected. I know var soundControl is simply storing a reference to soundControl\_mc created earlier, but surely a ‘this’ reference should point to soundControl\_mc??? :huh:

Can anyone elaborate on the problem I’m having here? I can get to work taking away ‘this’ and using ‘soundControl’, but it just doesnt make sense to me…

```auto

soundControl = this.attachMovie("soundControlClip", "soundControl_mc", this.getNextDepth());
soundControl.onPress = function() {
		track_sound.stop();
		this.tween("_alpha", 0, 0.500000, "easeOutCubic", 0, function () {
			this._visible = 0;
		});
	};

```

Thanks!
