View Full Version : Need help on making a console....
emeX
July 15th, 2003, 04:43 PM
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.....:)
Danneman
July 15th, 2003, 08:54 PM
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.
emeX
July 15th, 2003, 09:13 PM
can i have actionscript execute code when a certain string is entered
Danneman
July 15th, 2003, 10:03 PM
How do you mean? Give a concrete example, and I think it will be doable.
blah-de-blah
July 15th, 2003, 11:11 PM
i think so..>?? Wouldnt' it just be like:
if (whatever.text == "whatever") {
do whatever
}
emeX
July 16th, 2003, 12:09 AM
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
blah-de-blah
July 16th, 2003, 12:29 AM
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
kode
July 16th, 2003, 12:31 AM
if (input.text == "Guest") {
dynamic.text += "\rPassword:";
}
;)
blah-de-blah
July 16th, 2003, 12:34 AM
ooh....i guess its solved then...but what does /r do kax?!?
emeX
July 16th, 2003, 12:35 AM
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...
kode
July 16th, 2003, 12:39 AM
Read this thread, blah-de-blah.
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=16274
blah-de-blah
July 16th, 2003, 12:42 AM
understood ;)
emeX
July 16th, 2003, 12:46 AM
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
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.