# Random Sentence Generator with Button? \[Flash CS4 - AS2\]

**URL:** <https://forum.kirupa.com/t/random-sentence-generator-with-button-flash-cs4-as2/325799>\
**Category:** flash\
**Created:** [November 4, 2011, 7:12pm UTC](https://forum.kirupa.com/t/random-sentence-generator-with-button-flash-cs4-as2/325799 "2011-11-04T19:12:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SNIPER](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@SNIPER](https://forum.kirupa.com/u/SNIPER)\
**Post date:** [November 4, 2011, 7:12pm UTC](https://forum.kirupa.com/t/random-sentence-generator-with-button-flash-cs4-as2/325799/1 "2011-11-04T19:12:58Z")

</div>

Hey guys,

Does anyone know how to make a pre-made sentence appear when a button is clicked? Can this be done with AS2? I need a button that when clicked will display a sentence at random.

The way I have it in mind is to make a movie clip with say 10 different sentences on 10 different frames marked with labels (Sentence1, Sentence2, etc.) and each time the button is clicked, it will pick a random frame label thereby displaying the sentence on that frame. I just need to know the actionscript to link to the button. Any help would be appreciated. Thanks.
