Unit 5 Lesson 6 Multiple text lines to format correctly

When I put in the multiple lines, they do not show new lines for the “\n” in the App:
Below is the code:
onEvent(“InputScreenBtn”, “click”, function(){
setScreen(“StoryScreen_PlayAgainBtn”);

var madLib = "Learning to drive is a tricky process. There " +
“are a few rules you must follow.\n\n” +
"1. Keep two [plural noun] on the steering " +
"wheel at all times.\n\n2. Step on the [noun] " +
“to speed up and the [noun] to slow down.\n\n” +
"3. Your parents will just LOVE it if you play " +
"[song] on the radio.\n\n4. Make sure to honk " +
“your horn when you see [verb] on a street sign.”;
setText(“StoryScreen_MadLibTextArea”, madLib);
});
onEvent(“StoryScreen_PlayAgainBtn”, “click”, function(){
setScreen(“InputScreen”);
});

(I realize this is an old, old questions. But this problem comes up often during this lesson so I wanted to share a LIKELY solution.)

The message needs to be written in a “Text Area” and NOT in a “Text Input.”

Make sure the design element students are using for the message is a Text Area.

1 Like