Step 8. Dialog
In the first room, make the dialog into a symbol.
Use this as the place to design your dialog box. Once you’re done with the design, exit out and turn it into a MovieClip symbol. This is where the animation will be added, of it popping up. Inside this symbol, animate it. I gave it a pop-up with a fade.
(Pro tip #5: Make sure the last frame has a stop(); to prevent it from looping forever)
For the last time, convert it into a symbol where it will be used to house all the text in the game.
Inside this symbol, create 3 layers.
Make the first frame empty, except for the dialog bubble. Make the second frame empty and make a third frame for your first dialogue. Add some text in the bubble layer. If you want to add more dialogue, then add more frames. Once the string of texts is done, make it empty.
When I click on the cheese, it says two things, then ends. On the first frame in the action layer, add this.nextFrame(); So when the game starts, you won’t see an empty dialog box at all times. Now add a fourth layer for the labels.
On the empty frame inside the code layer, add a this.gotoAndStop(“nothing”);
Now, to make the dialog work. Exit the dialog and give it an instance name. Then, in the code in the room, make it so that when an object is clicked, it goes to that label.
this.cheezmc.addEventListener(MouseEvent.CLICK, cheezget); function cheezget(event: MouseEvent): void { this.textboxmc.gotoAndStop("cheez"); this.cheezmc.visible = false; Object(root).game.Inventory.Invbox3.Itemboxflash.gotoAndPlay(1); Object(root).game.Inventory.Invbox3.gotoAndStop("cheez"); }
Inside of dialog, make a large transparent white rectangle that covers the whole screen, convert that into a symbo,l and give it an instance name. This is needed so you can click anywhere to continue the text.
To make it so the dialog continues on click, give the textbox an eventListener
this.textboxmc.addEventListener(MouseEvent.CLICK, continuetextbox); function continuetextboxmc(event: MouseEvent): void { }
Make it so that on click, it goes to the next frame
this.textboxmc.addEventListener(MouseEvent.CLICK, continuetextbox); function continuetextboxmc(event: MouseEvent): void { this.textboxmc.nextFrame(); }