0

所以我做了4个场景。在第一个场景中有 2 个按钮,它们都进入相同的下一个场景。在下一个场景中还有另一个按钮,但根据您在第一个场景中单击的按钮,您将转到下一个。

让我们更清楚:

场景一:Button1 和 Button2

场景二:按钮

场景 3:基于 Button1 的结果

场景四:基于Button2的结果

这就是我所拥有的:

场景1:

button1.addEventListener(MouseEvent.CLICK, nextSceneB1); 
button2.addEventListener(MouseEvent.CLICK, nextSceneB2); 

function nextSceneB1(event)
{
    MovieClip(root).gotoAndPlay(1,"scene2"); /
}

function nextSceneB2(event)
{
    MovieClip(root).gotoAndPlay(1,"scene2"); /
}

场景二:dont know what to add here

场景三:Outcome based on Button1

场景四:Outcome based on Button2

我应该怎么办?

4

1 回答 1

0

场景一:

function nextSceneB1(e:Event):void
{
    // Create a field that keeps where to go next.
    MovieClip(root)['proceed'] = "scene3";
    MovieClip(root).gotoAndPlay(1, "scene2");
}

function nextSceneB2(e:Event):void
{
    // Create a field that keeps where to go next.
    MovieClip(root)['proceed'] = "scene4";
    MovieClip(root).gotoAndPlay(1, "scene2");
}

场景二:

function nextScene2B(e:Event):void
{
    // Use the kept field as an argument.
    MovieClip(root).gotoAndPlay(1, MovieClip(root)['proceed']);
}
于 2018-03-28T22:12:38.403 回答