mike
mike

Reputation: 3

Doesn't go to the right frame

I have three frames. The first frame is the original. When the marker hits the right answer (target i should say), it must proceed to frame 3. If the answer is wrong it should go to frame 2. But the things when the marker hits the right answer the frame that is being shown is frame 2 and not frame 3. Why is that so?

marker._x = 93.0;
marker._y = 62.0;
status.text = "ANSWER"

marker.onPress = function() 
{
    this.startDrag();
}
marker.onRelease = marker.onReleaseOutside = function()
{
    this.stopDrag();
    if(eval(this._droptarget)==A)
    {
        this._x = A._x;
        this._y = A._y;
        status.text = "CORRECT";

        gotoAndPlay("3");

    }
    else if(eval(this._droptarget)==B)
    {
        this._x = B._x;
        this._y = B._y;
        status.text = "WRONG";

        gotoAndPlay("2");

    }
    else if(eval(this._droptarget)==C)
    {
        this._x = C._x;
        this._y = C._y;
        status.text = "WRONG";
        gotoAndPlay("2");
    }
    else if(eval(this._droptarget)==D)
    {
        this._x = D._x;
        this._y = D._y;
        status.text = "WRONG";
        gotoAndPlay("2");
    }
    else
    {
marker._x = 93.0;
marker._y = 62.0;
    status.text = ""
    }

}

Upvotes: 0

Views: 270

Answers (1)

weltraumpirat
weltraumpirat

Reputation: 22604

Remove the quotes from your gotoAndPlay() statements.

If you are jumping to a frame number, it should be gotoAndPlay (2);, for example. You should use String values only for jumping to labelled frames, but label names should not be number characters.

Also, make sure you have a stop() somewhere, so that the movie will not just flash and pass over the frame you want to jump to. You could also use gotoAndStop();, by the way.

Upvotes: 1

Related Questions