...

View Full Version : Removing Extra Line in Multiline Input Text (AS3)



dougcollins02
05-21-2012, 06:49 PM
I'm trying to put an input text field on of my Flash projects, but whenver I put in a multiline input field Flash always changes the input field from completely empty to having an extra line in the text field.

This is a problem as I'm using a code to validate that the field is not empty (which is not the problem-- the code works fine with an input text component, but not one that's drawn on the stage).

Does anyone know how to get rid of this m!@&#r fu#$%*g line? It's driving me nuts.

dougcollins02
06-04-2012, 04:28 PM
*bump* Anyone? **crickets**

Lerura
06-04-2012, 05:01 PM
if you took you time to post your code, then someone here would probaly be able to help.

Without the code, noone will able to help you.

dougcollins02
06-05-2012, 06:13 PM
Seriously, Lerura? This is **not** a problem with my code. It works as designed. This is a general question revolving around an input text box, and how to stop it from displaying a second line. Unsurprisingly, no one in this forum has been remotely helpful in answering this question, Lerura included.

Seriously, the people in this forum are the most unhelpful and sarcastic lot around. I hate coming here for help because the members are always as petulant as the post above. I've always been polite to be careful and respectful when asking a question. The vast majority of responses I've gotten have been as high-and-mighty as the one here. With the exception of a very small number of genuinely helpful and understanding users, I get the feeling that everyone here users their tech skills to "look down upon the masses" and feel superior to others.

Case in point: Lerura's response was meant to show her(?) mental superiority by implying that I was too stupid to know that I would have to supply code to receive help. If I humbly submitted my coding work, her noble self would be bothered to take the time to help me out.

Seriously, how condescending can you get? I've always hated to see these type of responses on these forums. It's polite to ask questions about someone's code, if you think it's relevant. It's even perfectly acceptable to ask them to post code, but for God's sake don't be a jerk about it. Is that too much to ask?

I know most of us asking questions are beginning to intermediate coders who need some help going in the right direction. I know most of us answering questions are experienced coders taking time to help out (and possibly build some of their own skills in the process). It's a great system, but for the love of all that's good and holy, if someone asks you for help, either make a genuine, friendly attempt to help them or stay out of it. Being a jerk doesn't get anyone anywhere, and only dissuades people from asking for help in the future.

As it happens, I had this exact question answered on another forum some time ago, without submitting any code. I was bumping here to see what kind of response I'd get. And guess what? It was exactly the type of response I expected. Rude and petulant.

For the sake of anyone who comes looking for this answer in the future, I'm going to go ahead and answer my own question, since no one else here seems to be able to do so. I'm also going to warn them against posting even the simplest questions here, if they're not big fans of verbal abuse.

As it turns out, you only need one very simple line of code to fix this problem. To solve it, you simply put the following at the start of your action script, before any function:


inputField.text = "";

...where inputField is the instance name of your input text box.

This will effectively remove any difficulty with a second line showing up in an input text box, and is very useful in solving in problems when checking for a blank text field in using if/else statements in AS3.

Lerura
06-06-2012, 02:21 AM
Seriously, Lerura? This is **not** a problem with my code. It works as designed. This is a general question revolving around an input text box, and how to stop it from displaying a second line. Unsurprisingly, no one in this forum has been remotely helpful in answering this question, Lerura included.


Your code works as intended? Why are you then posting for help to fix a problem with.

And how should we be able to help you if we can't determine what causes it.
Unless you post some code, we will have no chance to spot the error.
There is no universal fix.

Okay you gave us a little code anyway!

The only thing I can tell you for now is that the text you write in a input text box is refered to as .value not .text even if it might work insome browser

dougcollins02
06-06-2012, 05:46 PM
It's just not worth arguing over. My points have been made. That said, don't replace .text with .value; it could break your code (it did in my situation).



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum