Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Restrict The Amount Of Text In Input Box



Need to figure out how to restrict the amount of text in input box....

I'm working on a training CDRom where there are interactive pages for people to keep notes and do the tasks. I need to make sure that the boxes with the text input do not exceed their own size, ie not shift text up when there is no more space - if that makes sense....

I've tried counting the characters (to add the number into the 'MaxCaracters') via text mock up but it just doesn't quite seem to work perfectly, depending on text typed in, it works with certain bits of text and doesn't with other bits.... do to with the width of characters, I guess...

Does anyone know of anything that would help me here? Any thought? Tips? Or tricks?



ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 03-21-2004, 08:14 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

INPUT TEXT - How To Restrict Number Of Lines Of Text A User Can Input Into Textbox
In a flash form I've created I have a input textbox. I don't want the user to be able to input more than 7 lines of text. Is this possible to do? I know that I can set a value for 'max char', but this is not useful for me -- it's essential that the user cannot input more than 7 lines of text.

How can I limit the number of lines a user can input into a textbox?


Thanks!
Glenn

Restrict Text Input
I have a chatroom which uses htmlText.text to show the messages in a text area, but I don't want people entering html codes. So I decided to restrict the usage of the characters "< > { }". I set ^<>{} in the "restrict" field of the component inspector and it works fine. I'm just wondering if theres something I'm overlooking or if theres a better way. The thing I'm worried the most about is that I know theres a weird round-about way to insert characters with number codes or something and I want it fool-proof. My php script that the text input submits to will validate the info anyway, but I'd like it checked at both sides.

I believe the answer is as simple as using htmlentities for the message coming from flash to PHP, but I wanted to double-check. Maybe theres other security issues I should protect against?

Restrict An Input Text Field
Hey,

I would like to know how I can restrict an input text field to only contain Number and no letters or punctuation.

Also can you set a dynamic text field to display as Bold only when a certain value provides true?

Thanks again.
Joe.

How To Restrict Input Text Based On Position?
Input text fields have a maxlength.
Input text fields have a restrict option so it's possible to block certain characters.
I would like to restrict input based on the caret's position in the textfield. Is this possible?
I'm able to retrieve the caret's position in the onChanged handler.
Can I clear the buffer in the onKeyDown?

Btw, the object I'm trying to put together is a textarea with one or more input fields inside. So, it's static text, followed by input text, followed by static text, etc.
My first try came down to putting textfields on top of each other, set autosize to true, and expand the static part along with the input part with an onchanged handler. Too bad this only works for one line of text. With more lines, wrapping becomes an issue.

Suggestions are most welcome.

---

Just thought of something. Is the textfield listening to the Key object? If so, can I detach it, and create my own handler especially for my textfield?

Howto Restrict Input Text In A Button?
Hi,

I know how to restrict an input text...


Code:
myInputtext.restrict = "a-z"
But when I create a button of this inputtext, it doesn't work anymore...

Can I solve this?

I already tried things like...


Code:
myButton.myInputtext.restrict = "a-z"
or...


Code:
_root.myInputtext.restrict = "a-z"
But that didn't work...

Paul

How To Restrict Characters In Input Text Field
Hi,

I have an Input Text field and I want it in such a way that user should not enter any character(any thing including all possible characters) in to that text field.

For that I use, flash's rectrict feature. The snippet of the code is:


Code:
myText.restrict = "";
whereas myText is Var name of the input text field.

In flash's help they have written that "If the value of the restrict property is an empty string, you cannot enter any character".

But when I publish the file, I discovered that I am able to enter anything inside text field. Am I wrong somewhere?

Any expert help in this regard?

Thanks,
Guy Logical

Input Text Length & Restrict Question
Hello, I have an input text in flash 8 that the user will enter their zip code... I want to restrict all characters except numbers... also, i have a search button next to it and when the search button is pressed I have a window open up... i only want the window to open up if there are 5 characters in the text field...

to restrict the characters i named the text instance custzip and added this actionscript to the keyframe.. but it does not work...


Code:
custzip.restrict = "0-9";
to only allow the window to open if there are 5 characters in custzip .. i added the following actionscript to the button


Code:
on (release) {
if (custzip.length=5) {
getURL("javascript:openWin('results.php?s_Dealer_Zip="+_level0.home.custzip+"&s_Dealer_Radius=50', '500', '500')", "", "POST");
}
}
can anyone explain what im doing wrong?

here is the site i am compiling.. i know it is not good but im fairly new at flash and actionscripting...


http://www.guttershell.com

Restrict Input
I need it so that only numbers can be typed into the input text field

I've been trying this for a while now, I have already tried textfield.restrict(0-9); and textfield.restrict = "0-9"; and other such codes, but with no positive results

I do already have a button that checks if the value in the text field is between certain values and if there not it returns an error statement, I was wandering if i could put an if statement there to check if there are only numbers in the field

Help would be much appreciated

Restrict An Input Box
Hey guys,

I was just wondering how can I restrict an input box to only accept the numbers 1,2,3,4 or 5 but nothing else.

any help would be appreciated!

Restrict Input To Numbers Between 0 And 10
I can't figure out how to restrict an input field to only allow numbers between 0 and 10 - not 11 or above.
I have set the Maximum characters to 2 and
code: textfield.restrict = "0-9";
...but that still allows 11 trough to 99.

How is it done ?

Restrict Input Field To Float
hi all

i need to have a textfield which is restricted to a float with maximum 2 numbers before and 2 numbers after the point:

like that 34.12

is that possible???

please help

thank a lot

cheers

marcel

Restrict Char Input Of Textfield
Hi guys,
quick question,

Is it possible to restrict what it typed into an input textfeild. Actually what i am trying to do is restrict caps being used in a password textfield. So if the caps lock is on the user gets and message saying not to use caps?

Anyone

Cheers

Restrict Char Input Of Textfield
Hi guys,
quick question,

Is it possible to restrict what it typed into an input textfeild. Actually what i am trying to do is restrict caps being used in a password textfield. So if the caps lock is on the user gets and message saying not to use caps?

Anyone

Cheers

Urgent: Restrict 'Enter Key' In Input Field
hi there,
can anyone point me out how to restrict the 'enter Key' (both main and on numpad) in an input field?
i.e. the user may NOT use the enter key and i'm having a multiline text input.

after some time i finally found the unicode "carriage return" escape but that does'tn work. Avoiding the spacebar however does work :s

fld.restrict = "^u000Du0020"


pls help ...!
thx
klikfabriek

Input Field: Restrict To Numbers INCLUDING Space?
Hi all, I'm trying to make an input box restricted to characters 0-9 including the space bar.

I can do;

mytext.restrict = "0-9";

but how do I account for space? any ideas or solutions would be greatly appreciated.

Input Field: Restrict To Numbers INCLUDING Space?
Hi all, I'm trying to make an input box restricted to characters 0-9 including the space bar.

I can do;

mytext.restrict = "0-9";

but how do I account for space? any ideas or solutions would be greatly appreciated.

Maximum Amount Of Input For Socket Object
Is there a maximum amount of data that a Flash socket object can handle?

Restrict Drag Area - Restrict Dragging If Pointer Goes Out Of Dragable Object
if press mouse and drag object it works but onpress pointer on stage I want to restrict draging. just want to restrict dragging if pointer goes out of dragable object
pls help

a.onPress = function () {
startDrag (a, false, 0, 110, 960, 110);
};
a.onRelease = function () {
stopDrag ();
};

No Restrict To Madness (restrict Property)
restrict (TextField.restrict property) is not reliable!
Using it in a very important Flash Form is actually driving me mad as users, despite this applied property, are able to enter ";" or "?" or ":" in Email Textfield on which the restrict property specifies: _root.mcEmail.restrict = "-_.@a-z0-9^A-Z";
What should be done to make this property work for good?

Text Restrict
ok, i understand how the myText.restict works, but what I want to do is if the user types in curse words, it filters
like
if they typed out ****, it would be censored to s**t, or something.
thanks

On Amount Loaded = Total Amount , I Want To Display Something Else.
I have a preloader for the movie, and while the preloader is loading, there is an animation going on. It says "Loading_", with the underscore flashing. I want to make the "Loading_" MC say something else when the amount loaded equals the total amount, in other words: when it reaches 100% loaded, i want "Loaded_" to change to "Finished". Can someone help me out?..I'm doing a website for a band and they want it done relatively soon.

Thanks,
David "O"

How To Restrict The "-" In An Input Field.
hey fellaz,

How can I restrict the - character in an input field?
cause this doesnt really work


ActionScript Code:
telefoon_txt.restrict = "0-9, -";

Using Restrict 0-9 But Pos To Clear Text With A-z Key?
Hi guys
I am using restrict to stop users entering 0-9 into a text area. All works fine with one exception, when I highlight existing text and press a letter key it clears the content. Anyone know a way to stop this?
Thanks in advance
Ol

Resising A Dynamic Text Field Depending On The Amount Of Text...
Hi all...

I have a flash movie reading a xml file...

i m getting a list of questions and their respective answers...i d like to load those answers into a Mc that contains a dynamic text field ...

the question is:

how can i "resize" (add lines) my dynamic text field depending on the amout of text - i tried getting maxscroll and resizing but that only makes it bigger and doesnt add any additional lines like i d like it to...


thanx 4 ur help

Restrict Symbols In Dynamic Text Box
How would I restrict symbols and uppercase letters in a dynamic text box. (ie: password, username)

Do I have to setSelection() and list only the text I want? or is their an easier way

Is There A Way To Make A Dynamic Text Box Resize According To The Amount Of Text?
Is there a way to make a dynamic text box resize according to the amount of text?

If so, then how?

thanks

Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,

I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}

the text code is:
stop();
loadVariables("biosText.txt", this);

Thanks

Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,

I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}

the text code is:
stop();
loadVariables("biosText.txt", this);

Thanks

Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,

I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}

the text code is:
stop();
loadVariables("biosText.txt", this);

Thanks

Scrolling Text Have A Limit On Amount Of Text It Can Scroll?
Hi all,

I've created a dynamic scrolling text field with two buttons up and down. It seems to work fine except that it won't scroll the entire document. It gets about half way and just stops and won't let you scroll any further. I can't figure this one out and I can't seem to find any info on any forum. The file was created in text edit and doesn't have any funky characters in it and the down button code is:
on (release) {
biosText.scroll+=5;
}

the text code is:
stop();
loadVariables("biosText.txt", this);

Thanks

Dynamic Text & XML: Detecting Amount Of Text
When using dynamic text, and loading in text from an xml. How do you get the Dynamic text box to automatically adjust (height) to the length of the text?

Working With Large Amount Of Text
I am working with a large amount of text ( abound 9 pages word ), and flash became really slow . Is that anyway that I can compress text or made it faster? I used scroll box component and some text is missing ??

Please help me, please !!!! hu hu hu

Scrolling Large Amount Of Text...... HELP
Hello, i´m new to this site...

I have a problem with scrolling a large amount of text.
im using a movie clip where inside this MC is a text tool, i copy then paste from word aproximate 120 pages.

I use scrollpane that scrolls the instance of the movie.

My problem is that the text box, aparently it does paste all the text but when i test the movie, all the text is mess up, it only like two pages whit text over text etc that scrolls.

Can some one help me how to scroll large, 120 pages of text.

Or to import a word or text file with this 120 text and scroll it

Thanks

Best Way To Load Large Amount Of Text
so i have a large amount of text to display in a smaller area, and so it needs to scroll.

I am assuming that i should just load it via scroll pane.....is this the best way? the text needs to be a certain font so....what i am currently doing is having my main movie and loading in another one called history.swf, in this file i want the scroll pane to be placed and display the text......

is this the wrong way to do what im trying to do, please answer asap

thanks

How To Load A Large Amount Of Text
what is the best method to load a large amount of text

Im loading a 'history' of a theatre and so its rather lengthy, but the space provide is not large enough to display it all.....

scrollpane?

whats the best way, smallest file size way..

??

please help asap

[MX04] Set Amount Of Chars Between Text
alright, say if I had 2 text input boxes, (for the sake of it, tInput1, tInput2). I want it to show up in a different text area with a set amount of characters inbetween them. So say if someone were to type in tInput1 "House", that is 5 charcters. I want the total amount of charcters to tInput2 at 10.
so for example: House-----tInput2 (- represent characters).
No matter the length of tInput1, the distance to tInput2 will always be 10 characters.


I am not sure how to go about doing this, if anyone has any tips they are greatly appreciated. (I was searching a while and couldnt find anything about this)

Scrolling Infinite Amount Of Text
Hi!

I am trying to create a text crawler that will display very long texts. (>4000 chars). I have encountered some problems and I am not sure which way is the best to solve them.

Problem no 1: The TextField class seems to go insane when I feed an instance with more than 3244 characters.

Problem no2: For the text to run smoothly I need to bitmap cache it. And if I bitmap cache very long text fields it will eat memory and run slow because of that.

To solve these problems I figured that I somehow need to split the text into smaller chunks. The thing is that when i do that it will be a hell to keep track of them, how many characters should each chunk have (depending on font size), which one is displaying right now, which one to remove from the display list, which one to add and when (to overlap seamlessly with the previously).

So I was just wondering if I am missing some neat class that actually handles long scrolling texts or if anybody has developed something similar and might want to give some hints on how to solve this in a nice way.

Thank you!

How To Insert A Large Amount Of Text?
I'm creating a flash presentation. There is a menu that will show 6 titles
of documents. When user selects any title the content should be displayed.

The problem is that every document is about 30-50 pages! I tryed to use a dynamic text, but it is very slow and can't show all the text (alas it has length limits). Movie becomes very slow when it opens any document.

Is there any other ways to display "large" amount of text with pictures, something like "HTML in Flash" movie?

Thank you very much...
ths@smtp.ru

TextInput Change Focus After X Amount Of Text
I am sorry if this has been posted, I have searched for the better part of two hours.

I have three textInputs (phone number) text_phone1,text_phone2, and text_phone3. I would like, after 3 numbers are put into text_phone1 to change focus to text_phone2, then after 3 numbers are put into text_phone2 to change focus to text_phone3. I am a compleate noobie so please don't bash to hard on my noob-ness.

This is for a Flash form using AS3.0

Thanks for any help at all!

Is It Possible To Dynamically Set The Height Of A Textfield According To Text Amount?
is it possible to dynamically set the height of a textfield according to the amount of text that's been externally loaded?
say if I only have a line of text to load in to a textfield, then that textfield could adjust is height to only the height of a line of text.
and if it is a paragraph, then the textfield will load the text with lenthened height.
is it possible to achieve that? to have a text field adjust its height according to amount of text loaded?

How Can I Adjust The Scrollbar To The Amount Of Text Inside In This .fla File?
I have a text scroll bar for my movie that I use throughout this website I created.

For the life of me, I can't figure out how to adjust this scroll box so I can add more text, if needed.

It's very limited. I can only add so much text and then it cuts it off, so when I publish the movie it would display all the text inside. I need to make the scroll box longer. I can't even adjust the speed of the floating scroll. I attached the file to this posting.

If anybody has knowledge of this, Please help!

Thanks,
Tom

Limiting Amount Of Lines Dynamic Text Field
Dear Flash Forum

I'm retrieving text content from an xml file and I need to limit the amount of lines. Basically if the content needs 10 lines to be displayed only the first 5 should show up. No scrolling.

Can this be done?

Any leads or ideas appreciated.

Thanks

Stephan

Loading Txt Files Dynamically, Is The Amount Of Text Limited?
Hello,

I've been using a scrolling list of gigs for a website, the text is loaded from a txt file and formatted with html (the font is embedded).

Here* is just the page on its own

(scroller on the right) This has been working fine up until now, I've been required to add more dates to the list.... Only about quarter of it is cut off the bottom, and it is always in the same place which would suggest that there is a limit to the amount of text this can hold !! Is this the case? If so does anyone have any suggestions as to what I can do about it?

Thanks in advance!

Pat

Flash8 * Limit The Amount Of Characters In Dynamic Text.
hi all,

i am struggling with the following.

A have a big chunk of dynamic text (from a db). From this text i am making a .pdf.
So i would like to limit the amount of outputted text as a page can run out of space.

I have tried to do it with search and replace. But the problem is that it counts only characters instead of characters in combination with whitespace and the number of lines.

There is space for 100 characters/spaces on each line, and a total of 38 lines on one page.

So i am thinking of something like this:
* count all new lines represented by

* count all characters/whitespaces dived to the number of lines to check if this fits the number of
(as it uses wordwap)

Anyone with bright ideas on how to approach this?

(btw. TextField.maxChars will not work as it's dynamic text...)

Help With Email Form - Input Text Boxes Not Allowing Input
i placed an email form into a movie clip in this site...and the input text boxes are no longer allowing me to type into them.

the email form (which i got from flashkit), as it's own file, works fine, so i know it's possible...but for some reason when i take the movie clip from one file and drag it into the one i'm working on...it loses that input text funcionality. All the actionscript is the same...everything is identical...i don't get it.

i even tried to place it on top of a movie clip within the main content clip thinking maybe because it was an mc within an mc within an mc that had something to do with it...but not the case.

any help you can provide is appreciated.
(attached file was saved as MX..orig is in MX 2004 Pro)

thanks.

oh, also....how would i load movie clips to different layers?...if i understand some things i've read here, that will help me speed up the site overall...as it is VERY slow in browser. but...maybe i'm wrong.

Remove Input Text On Input Text Box Select?
Right now I've got an input text box with an instance name of EMail and Var of EMail. Then in my AS I've got:

code: var EMail:String = "Enter Your Email Address";

which puts "Enter Your Email Address" in the text box when it displays. What I'd like to do is when a user clicks inside the box to enter their email address is for that string to disappear.

Input Text To Show Up In Input Text Box In Later Frame
Hi, I am making a game where the player enters his or her name into and input text box at the beginning and then prints out a certificate at the end with his or her name on it. This is the actionscript I am using, however, this only allows me to have the box where the player enters his or her name to be on the same frame as where the text appears.

input_txt.onKillFocus = function () {
user_name = input_txt.text;
input_txt2.text = user_name;
}
_global.style.setStyle("fontSize",30);

I was wondering if there was anyway to modify this script to make it so that the name appears in the input_txt2 box in a later frame.

Thanks,

Lindsay

What Are The Best Ways To Capture Input From An Input Text Field?
Hi,
I don't know ASP, CGI, PHP etc. I do, however, have a flash form with two input text fields named “E-mail” and “Name”, and a submit button.

How can I set this up so a user can input the info in these two fields and click the submit button to some how send me the data - Via Email? txt on the server? Anything...

Also, if this is not possible, what is the simplest way to learn PHP or whatever is most appropriate to get these goals accomplished.

Thanks,
Stephen

Converting Input Text To Non-input With Actionscript
Is it possible to set a text field whose property is Input to Static Text with Actionscript?

Copyright © 2005-08 www.BigResource.com, All rights reserved