Need help on making a console

Im am trying to make a console like a emulator for dos if u will…
The only problem is that i dont know if this is possible in Flash. I have tried using a Input Text Field Box but i dont know how to verify input without a button. I also do not know how to print text to the input text field box. And is there any way to change the input text blinking cursor to like a square???

Help would be much appriciated…:slight_smile:

So you want to verify/update data with the push of “Return”, am I right?

Well, you can have your ActionScript execute code when a particular key is pressed by using a Listener.

I havent tried this myself, but check it out:

userKey = new Object();
userKey.onKeyDown = function(){
if(Key.getCode() == 13){
// Update/verify data-code here
}
}
Key.addListener(userKey);

Every key is identified by a different number. I think 13 stands for “Return”, but Im not sure.

can i have actionscript execute code when a certain string is entered

How do you mean? Give a concrete example, and I think it will be doable.

i think so…>?? Wouldnt’ it just be like:

if (whatever.text == “whatever”) {
do whatever
}

But how do u like add text like say for example u have one input box and another dynamic box… then u code something like

if (Input eq “Guest”) {
Dynamic.appendText = “Password:”
}

I know this function doesnt exist but i just want to know how to add text to like the next line…
Im trying to make a console…
thanks

i’m not sure what you mean by add text to next line…or even what you mean by making a console :-\ Can you explain? if u have an example htat would be even better

[AS]if (input.text == “Guest”) {
dynamic.text += “\rPassword:”;
}[/AS]
:wink:

ooh…i guess its solved then…but what does /r do kax?!?

by console i mean like a input box that takes commands like MSDOS. like for exaple u have one box that displays text which is a dynamic text field and and another text field thats is a input box that accepts user input. i want to have user to be able to type in the iput box and have the dynamic box verify it and print out what the user inputted in the dynamic text box… also have it accept commands… its a command propmt basically…

Read this thread, blah-de-blah.

http://www.kirupaforum.com/forums/showthread.php?s=&threadid=16274

understood :wink:

Kax this script is not working for me i tried it do u have a .fla ???
this is what i put:

on (keyPress “Enter>”) {
if (Input.text == “Guest”) {
Console.text += “\rPassword:”;
}
}

Input is my input text field
Console is the Dynamic text field
and this script is applied to a button…

thanx