# Confusing Function Scope problem

**URL:** <https://forum.kirupa.com/t/confusing-function-scope-problem/197154>\
**Category:** flash\
**Created:** [August 14, 2006, 10:15am UTC](https://forum.kirupa.com/t/confusing-function-scope-problem/197154 "2006-08-14T10:15:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamiehunter](https://avatars.discourse-cdn.com/v4/letter/j/d07c76/32.png) [@jamiehunter](https://forum.kirupa.com/u/jamiehunter)\
**Post date:** [August 14, 2006, 10:15am UTC](https://forum.kirupa.com/t/confusing-function-scope-problem/197154/1 "2006-08-14T10:15:29Z")

</div>

I have this function on my main timeline:

```auto
function Over(){
[LEFT] this.bg_mc.tween("_alpha", 0, 0.3)
}

```

[/LEFT]

This is basically a function for a Rollover so it is called on my button like this:

```auto

on (rollOver) {
[LEFT] _root.Over();
}

```

[/LEFT]

In theory, this should look into my button MC and fade bg\_mc. But it doesn’t work. However, if I change my function to this:

[LEFT]

```auto

function Over(){
    this.tween("_alpha", 0, 0.3)
}

```

[/LEFT]

Then it fades the whole button perfectly. Why won’t the function look inside the MC for bg\_mc? Is this a scoping problem?  
Thanks  
Jamie
