mardi 28 juin 2016

Actionscript 3 gotoAndStop in a branching storyline

I have created a simple gotoAndStop storybook in Flash but it's following branching storyline. The knight entered a castle and there is one gate. Upon entering the gate, he faced 3 more doors and each door, leads to another series of rooms.

However, the end will be the same. It appears to be a simple "gotoAndStop" codes but at the end of the of the story, the knight will earn some sort of price (represented by a frame) depending on which doors he entered. My question is, how will I know which buttons the user clicked so that i can "gotoAndStop" him to a certain frame? The final destination or award frame of user depends on which buttons he clicked.

This is my sample gotoAndStop code that I used in the storybook(similar code I used in all frames, just changing the button instance names, function names and frame labels):

nextbutton1.addEventListener(MouseEvent.CLICK, proceedDoor1);
function proceedDoor1 (e:Event){
    gotoAndStop("door1")
}

I am complete novice so please bear with me. Thanks!

Aucun commentaire:

Enregistrer un commentaire