Word box, but other than on tutorial

Hi,
I am trying to make something, but it doesn’t seem to work.
I want to make a word box that works like this: (i’ll now give a silly example, but just to show how it’s supposed to work)
You type in: Cow and you press enter
On the right you see: Animal that gives milk.

Can someone please help me? Use as less ActionScript as possible please, since i’m not very good at that.

Please help!!!

I was just working on something similar to this. Not exactly it, but close enough I suppose.

Create an input text box and give it the instance name “comment”. Create another regular dynamic textbox and give that the instance name “result”.

Now this is where we get Components involved.

Open the components panel (F11 in Flash), and drag an instance of the scrollbar component and attach it to your dynamic text box with the instance name “result”. Now drag an instance of the Push Button component onto the stage. Click on the push button and open the properties panel (CTRL+F3), Next to “label”, write the text you want to be displayed on the button (I used “Submit”). Now next to Click Handler, type in “onSubmit” (no quotes).

Now right click on a frame and open the actions panel.

Copy and paste this into the window…

//ifCow is the function to check if the word is "Cow" or "cow"
//if it is, then it diplays "Animal the shoots milk at people"
//the 
 refers to starting a new line
//comment.text="" clears the comment input text area
//the else statement says that if it is not cow, then just
//display the current text in the comment input text area.
ifCow = function () {
	if (comment.text == "cow" or comment.text == "Cow") {
		result.text += "Animal that shoots milk at people 
";
		comment.text = "";
	} else {
		result.text += comment.text+"
";
		comment.text = "";
	}
};
//function I use on the submit button
//when the button is pressed it calls upon th ifCow function above.
onSubmit = function () {
	ifCow();
};
//standard stop action
stop();

I commented all the code so it would be easier for you to understand what each thing does.

I hope that points you in the right direction :slight_smile:

well, since we were working on it at the same time anyway.

LOL, yours is so much simpler.

I told you I always do things the hard way :-\

I cant post my file because it is too big, which is weird because all it is is 2 textboxes, scrollbar component, and push button :-\

Odd.

You forgot to terminate your multiline comment though.

You need to add a */ to the end there.

Oh, man… I didnt forget, it’s just that if I added it, it would send my file size too high! hehhheehe… just kidding.

Here it is, fixed.

LOL, I still don’t get why mine won’t upload.

There is nothing in the library except the scrollbar component parts.

And last I checked… textboxes don’t take up much space :-\

Stupid file…LOL.

Well at least luster learns 2 methods here.

I see you like having fun with functions. Soon you will be prototyping everything, just like POM hahahhhahaaha…

Just kidding, Pom! You

:stuck_out_tongue: :stuck_out_tongue: :stuck_out_tongue:

Actually, I already do Function and Prototype most of my code…lol.

Thanks for helping me out!

No problem :slight_smile:

Thanks for helping me out!

Hey, don’t blame me about functions, Inigo, Supra talked me into it in the first place. :stuck_out_tongue:

And Lost, components take a huge amount of space if you don’t compress the code. I think there’s an option somewhere to do that.

pom :cowboy:

Pom, you know Im just messing with you. As a matter of fact, we’ll have to have a sitdown one of these days to talk about proto’s and such.

*Originally posted by Iammontoya *
**Oh, man… I didnt forget, it’s just that if I added it, it would send my file size too high! hehhheehe… just kidding.

Here it is, fixed. **

btw, didnt i post the same code on the other thread? :sleep:

Any time, Inigo :slight_smile: [SIZE=1]well, not right now, I really need to get some work done.[/SIZE] Avec grand plaisir.

Yeah Ilyas… yes I didn’t realize how much file size components take up, I just went to delete the Components folder in the library that Flash creates… and the scrollbar component uses 82 ITEMS!!!

:o

Pom, we’ll do that… I think I have just the thing we need.

h88. I have no idea what you’re talking about. However, I know that had I seen similar code somewhere, I would not have wasted anytime replying to a post. I’ve seen similar comments from you on some other posts as well. Hmm… oh well. Your help on this site is appreciated. As you can see, we all pull in and we do our part to make sure this site remains the most useful one out there.

Cheers!

There are only so many ways you could do that anyway, there is bound to be a code that looks similar.

*Originally posted by Iammontoya *
h88. I have no idea what you’re talking about. However, I know that had I seen similar code somewhere, I would not have wasted anytime replying to a post. I’ve seen similar comments from you on some other posts as well. Hmm.

sorry Inigo, but i meant i posted something similar to ur previous attachment, here, http://www.kirupaforum.com/showthread.php?s=&threadid=8844

*Originally posted by Iammontoya *
… oh well. Your help on this site is appreciated. As you can see, we all pull in and we do our part to make sure this site remains the most useful one out there

oh well, am really glad to be a part of you guys, thanx for your appreciation Inigo! =)

yours,
h88