# What is the code to create paragraphs?

**URL:** https://forum.kirupa.com/t/what-is-the-code-to-create-paragraphs/324540
**Category:** flash
**Created:** [August 26, 2011, 12:20am UTC](https://forum.kirupa.com/t/what-is-the-code-to-create-paragraphs/324540 "2011-08-26T00:20:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![learner\_7n](https://avatars.discourse-cdn.com/v4/letter/l/b2d939/32.png) [@learner\_7n](https://forum.kirupa.com/u/learner_7n)
#### Post date: [August 26, 2011, 12:20am UTC](https://forum.kirupa.com/t/what-is-the-code-to-create-paragraphs/324540/1 "2011-08-26T00:20:45Z")

</div>

Hi,

How can I create paragraphs wherever it is required. Currently it writes everything in a single paragraph. How to modify it?

```auto
var myString:String = "Learn to program arrays in flash to animate typing text. We use an EnterFrame event to animate the plucking of the array elements that are created by using split() on any string of text content. This can also easily have dynamic and external string data applied to the animation.";
var myArray:Array = myString.split("");
addEventListener(Event.ENTER_FRAME, frameLooper);
function frameLooper(event:Event):void {
    if (myArray.length > 0) {
      tf.appendText(myArray.shift());
    } else {
      removeEventListener(Event.ENTER_FRAME, frameLooper);
    }
}

```
