# Reading input string

**URL:** <https://forum.kirupa.com/t/reading-input-string/261488>\
**Category:** Uncategorized\
**Created:** [May 28, 2008, 5:21am UTC](https://forum.kirupa.com/t/reading-input-string/261488 "2008-05-28T05:21:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TVM\_XST](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@TVM\_XST](https://forum.kirupa.com/u/TVM_XST)\
**Post date:** [May 28, 2008, 5:21am UTC](https://forum.kirupa.com/t/reading-input-string/261488/1 "2008-05-28T05:21:30Z")

</div>

How to read a string from keyboard ,using AS3.0? Is there any standard input operator like cin in C++ ?

---

<div class="post-metadata">

**Author:** ![hasch2o](https://avatars.discourse-cdn.com/v4/letter/h/ba8739/32.png) [@hasch2o](https://forum.kirupa.com/u/hasch2o)\
**Post date:** [May 28, 2008, 6:59am UTC](https://forum.kirupa.com/t/reading-input-string/261488/2 "2008-05-28T06:59:46Z")

</div>

you need to give the user an Input field in order to let him put in some text.

If you want to read what the user writes without an Input field you could use an event listener on your stage, which listens to keyDown events and writes the pressed keys in an array or something.

---

<div class="post-metadata">

**Author:** ![Felixz](https://avatars.discourse-cdn.com/v4/letter/f/ecb155/32.png) [@Felixz](https://forum.kirupa.com/u/Felixz)\
**Post date:** [May 28, 2008, 5:18pm UTC](https://forum.kirupa.com/t/reading-input-string/261488/3 "2008-05-28T17:18:59Z")

</div>

or on change Event

---

<div class="post-metadata">

**Author:** ![Alex\_Lexcuk](https://avatars.discourse-cdn.com/v4/letter/a/919ad9/32.png) [@Alex\_Lexcuk](https://forum.kirupa.com/u/Alex_Lexcuk)\
**Post date:** [May 28, 2008, 8:17pm UTC](https://forum.kirupa.com/t/reading-input-string/261488/4 "2008-05-28T20:17:58Z")

</div>

It’s easy

```auto

my_text.addEventListener(Event.CHANGE,t_func);
function t_func(Event)
{
my_text_1.text=my_text.text;	
}

my_text_1.addEventListener(Event.CHANGE,t_1_func);
function t_1_func(Event)
{
my_text.text=my_text_1.text;	
}

```

[http://murmadillo.tut.su/fla/input-text.swf](http://murmadillo.tut.su/fla/input-text.swf)  
[http://murmadillo.tut.su/fla/input-text.zip](http://murmadillo.tut.su/fla/input-text.zip)

---

<div class="post-metadata">

**Author:** ![TVM\_XST](https://avatars.discourse-cdn.com/v4/letter/t/4af34b/32.png) [@TVM\_XST](https://forum.kirupa.com/u/TVM_XST)\
**Post date:** [May 29, 2008, 12:25pm UTC](https://forum.kirupa.com/t/reading-input-string/261488/5 "2008-05-29T12:25:26Z")

</div>

thanks!
