# FLASH MX 2004 - typewritereffect/buttons

**URL:** <https://forum.kirupa.com/t/flash-mx-2004-typewritereffect-buttons/37450>\
**Category:** flash\
**Created:** [December 10, 2003, 11:50am UTC](https://forum.kirupa.com/t/flash-mx-2004-typewritereffect-buttons/37450 "2003-12-10T11:50:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fernandez](https://avatars.discourse-cdn.com/v4/letter/f/58f4c7/32.png) [@Fernandez](https://forum.kirupa.com/u/Fernandez)\
**Post date:** [December 10, 2003, 11:50am UTC](https://forum.kirupa.com/t/flash-mx-2004-typewritereffect-buttons/37450/1 "2003-12-10T11:50:54Z")

</div>

FLASH MX 2004 - typewritereffect/buttons

Hello,

Does somebody know how to use the typewriter effect with buttons. By clicking a button a text should start ‘typewriting’. Each button has another text.

I’ve got this code to get the text shown inside the textfield (but there is no typewrite effect yet) in frame 1 of the \_root

\_root.MCWorld.usa\_btn.onPress = function() {  
\_root.country\_txt.text = “Your departure: United States of America”;  
}  
\_root.MCWorld.spain\_btn.onPress = function() {  
\_root.country\_txt.text = “Your departure: Spain”;  
}  
\_root.MCWorld.uk\_btn.onPress = function() {  
\_root.country\_txt.text = “Your departure: United Kingdom”;  
}

Maybe somebody knows how i can have less AS so that the function onPress is written only once for all the countrybuttons?

Thanx
