# \[CS3, AS2\] gotoAndStop (variable); Not Working

**URL:** <https://forum.kirupa.com/t/cs3-as2-gotoandstop-variable-not-working/281860>\
**Category:** flash\
**Created:** [February 13, 2009, 11:17pm UTC](https://forum.kirupa.com/t/cs3-as2-gotoandstop-variable-not-working/281860 "2009-02-13T23:17:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trouble](https://avatars.discourse-cdn.com/v4/letter/t/ee7513/32.png) [@trouble](https://forum.kirupa.com/u/trouble)\
**Post date:** [February 13, 2009, 11:17pm UTC](https://forum.kirupa.com/t/cs3-as2-gotoandstop-variable-not-working/281860/1 "2009-02-13T23:17:03Z")

</div>

Hello,

I’m using variables for the first time, and I didn’t know if I’m trying something that doesn’t work or what but here’s my problem (bear in mind this is only the test program, not the full project I’m attempting);

I have a simple 3 frame file.  
Frame 1 (main code, aka: the problem area)  
Frame 2 (gotoAndPlay (1)😉  
Frame 3 (Content Frame, aka: destination)

The concepts I’m trying to understand are two-fold: Creating Variable, and Loading them externally.

Here’s my code:

```auto
var varFrame: Number;
var my_lv:LoadVars = new LoadVars();

my_lv.load ("external_code.txt");

my_lv.onLoad = function(success:Boolean):Void {
    if (success) {
        trace(this.varFrame); // Number from external file.
    } else {
        trace("Error");
    }
}
this.gotoAndStop(varFrame);

```

and my external TXT file contains the Variable Value

```auto
&varFrame=3

```

I can get the project to return the number “3” to the output window, but I can’t get gotoAndStop (varFrame); to work.

Please help!

I understand this is a pointless program, but the project I’m building for work uses all these same lines of code (almost).

Thanks in advance,

Trouble (aka: Jeff)
