开发者

Doesn't go to the right frame

开发者 https://www.devze.com 2023-02-15 02:31 出处:网络
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 f

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 = ""
    }

}


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消