# Class scope and gotoAndStop

**URL:** https://forum.kirupa.com/t/class-scope-and-gotoandstop/275537
**Category:** Uncategorized
**Created:** [November 15, 2008, 3:51am UTC](https://forum.kirupa.com/t/class-scope-and-gotoandstop/275537 "2008-11-15T03:51:58Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Alluminitti](https://avatars.discourse-cdn.com/v4/letter/a/77aa72/32.png) [@Alluminitti](https://forum.kirupa.com/u/Alluminitti)
#### Post date: [November 15, 2008, 3:51am UTC](https://forum.kirupa.com/t/class-scope-and-gotoandstop/275537/1 "2008-11-15T03:51:58Z")

</div>

Hello,  
I have a flash file with three labeled frames (“intro”, “game” and “game\_over”). And an .as file called Application.as. In the 2nd frame of the flash file (“game”) I instantiate an instance of the Application class like so:

```auto
    
[LEFT][COLOR=#000000] **var** [/COLOR] app:Application = [COLOR=#000000] **new** [/COLOR] Application[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] ;[/LEFT]
addChild[COLOR=#000000]([/COLOR] app [COLOR=#000000])[/COLOR] ;

```

Within the Application.as file I invoke the function, gotoAndStop( “game\_over” ) whenever the game has concluded. My problem is that the previously noted invocation doesn’t transverse the main timeline to the “game\_over” frame, instead, it does nothing. I’m assuming this is a problem of scope.

Here is the Application.as file, please note that I’ve omitted a great deal of code for simplicity:

**Application.as**

```auto

 
[LEFT] **package**
**[COLOR=#000000]{[/COLOR]**[/LEFT]
 
[LEFT]**[COLOR=#0000ff]public[/COLOR] [COLOR=#000000]**class**[/COLOR] Application [COLOR=#0000ff]extends[/COLOR] [COLOR=#0000ff]MovieClip[/COLOR]**
**[COLOR=#000000]{[/COLOR]**[/LEFT]
 
[LEFT][COLOR=#0000ff]public[/COLOR] [COLOR=#000000] **function** [/COLOR] Application[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR]:[COLOR=#0000ff]void[/COLOR][/LEFT]
 
[LEFT][COLOR=#000000]{[/COLOR][/LEFT]
 
[LEFT][COLOR=#0000ff]gotoAndStop[/COLOR][COLOR=#000000]([/COLOR] [COLOR=#ff0000]"game_over"[/COLOR] [COLOR=#000000])[/COLOR] ;
[COLOR=#000000]}[/COLOR][/LEFT]
 
[LEFT][COLOR=#000000]}[/COLOR][/LEFT]
 
[LEFT][COLOR=#000000]}[/COLOR][/LEFT]

```
