# Object scope question

**URL:** <https://forum.kirupa.com/t/object-scope-question/149438>\
**Category:** Uncategorized\
**Created:** [May 29, 2005, 6:15am UTC](https://forum.kirupa.com/t/object-scope-question/149438 "2005-05-29T06:15:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aMado](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@aMado](https://forum.kirupa.com/u/aMado)\
**Post date:** [May 29, 2005, 6:15am UTC](https://forum.kirupa.com/t/object-scope-question/149438/1 "2005-05-29T06:15:04Z")

</div>

Hello. I haven’t asked for help in a long time so I’ll get to the point.

I have:

```auto
MyPlayer = function()
{
   this.n = 0;
};

_global.player1 = new MyPlayer();

```

in layer 1 of my movie.

later, in clip1 of layer 2 i have

```auto
onClipEvent(load)
{
    _global.player1.n = 300;
    trace(_global.player1.n);
}

onClipEvent(enterframe)
{
    _global.player1.n += 3;
    trace(_global.player1.n);
}

```

I am coding in flash mx, and when I run the movie it traces

```auto
300
303
3
3
3
3

```

I read the Variable scope tutorials and I understand most of it, but I dont know why \_global.player1.n doesn’t increase by 3 like I want it to?

thanks!
