RE: [Flashcoders] Restrict textarea

2006-05-13 Thread Matthew Simpson
add in the special chars you want removed...


class Text {
   static function trim(str:String):String {
  //trace(Text.trim called:  + str);
  if (typeof str != string) return ;
  var whiteSpace =  \r\n\t\f;
  //Make sure str is a string
  var startPos = 0;
  //Note: if 0 length string startPos will be 0
  var endPos = str.length-1;
  //Note: if 0 length string endPos will be -1
  while (startPosstr.length) {
 if (whiteSpace.indexOf(str.charAt(startPos))0) {
break;
 } else {
startPos++;
 }
  }
  while (endPos-1) {
 if (whiteSpace.indexOf(str.charAt(endPos))0) {
break;
 } else {
endPos--;
 }
  }
  if (startPosendPos) {
 return ;
  }
  return str.substring(startPos, endPos+1);
   }

   static function strip(str:String):String {
  //trace(Text.strip called:  + str);
  var whiteSpace = \r\n\t\f;
  var tempStr = ;
  for (var i = 0; i  str.length; i++){
 var c = str.charAt(i);
 if (whiteSpace.indexOf(c) == -1) {
tempStr += c;
 }
  }
  return tempStr;
   }
   
}


-Original Message-
From: [EMAIL PROTECTED] on behalf of Jonathan Berry
Sent: Sat 5/13/2006 1:08 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Restrict textarea
 
Users are copying and pasting from a command line program and we are getting
some special characters that are coming through.

On 5/12/06, Matthew Simpson [EMAIL PROTECTED] wrote:

 Jonathon,

 I'm not sure I understand...A user is inputting the special characters as
 they type?

 Matthew

---
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Re: [Flashcoders] Restrict textarea

2006-05-13 Thread Jonathan Berry

Thank you, Matthew. I will adapt this.

On 5/13/06, Matthew Simpson [EMAIL PROTECTED] wrote:


add in the special chars you want removed...


class Text {
   static function trim(str:String):String {
  //trace(Text.trim called:  + str);
  if (typeof str != string) return ;
  var whiteSpace =  \r\n\t\f;
  //Make sure str is a string
  var startPos = 0;
  //Note: if 0 length string startPos will be 0
  var endPos = str.length-1;
  //Note: if 0 length string endPos will be -1
  while (startPosstr.length) {
 if (whiteSpace.indexOf(str.charAt(startPos))0) {
break;
 } else {
startPos++;
 }
  }
  while (endPos-1) {
 if (whiteSpace.indexOf(str.charAt(endPos))0) {
break;
 } else {
endPos--;
 }
  }
  if (startPosendPos) {
 return ;
  }
  return str.substring(startPos, endPos+1);
   }

   static function strip(str:String):String {
  //trace(Text.strip called:  + str);
  var whiteSpace = \r\n\t\f;
  var tempStr = ;
  for (var i = 0; i  str.length; i++){
 var c = str.charAt(i);
 if (whiteSpace.indexOf(c) == -1) {
tempStr += c;
 }
  }
  return tempStr;
   }

}


-Original Message-
From: [EMAIL PROTECTED] on behalf of Jonathan
Berry
Sent: Sat 5/13/2006 1:08 AM
To: Flashcoders mailing list
Subject: Re: [Flashcoders] Restrict textarea

Users are copying and pasting from a command line program and we are
getting
some special characters that are coming through.

On 5/12/06, Matthew Simpson [EMAIL PROTECTED] wrote:

 Jonathon,

 I'm not sure I understand...A user is inputting the special characters
as
 they type?

 Matthew

---
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com





--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com

---

This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged.
This information is confidential information and is intended only for
the use of the individual or entity named above. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.

---
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


[Flashcoders] Restrict textarea

2006-05-12 Thread Jonathan Berry

Hello all,
I googled and read the livedocs and searched the archives for this to no
avail. How can one restrict carriage returns and newlines in TextInput and
TextArea components? I tried
input_ti.restrict = \u0020-\u007F; and input_ti.restrict =
^\u-\u0019;
but no luck with those. There appears to be some sort of carriage returns or
new line characters that are getting through. Hope you can advise or send me
a link. Thanks in advance.
--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com

---

This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged.
This information is confidential information and is intended only for
the use of the individual or entity named above. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.

---
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


RE: [Flashcoders] Restrict textarea

2006-05-12 Thread Matthew Simpson
Jonathon,

I'm not sure I understand...A user is inputting the special characters as they 
type?

Matthew


-Original Message-
From: [EMAIL PROTECTED] on behalf of Jonathan Berry
Sent: Fri 5/12/2006 6:24 PM
To: Flashcoders mailing list
Subject: [Flashcoders] Restrict textarea
 
Hello all,
I googled and read the livedocs and searched the archives for this to no
avail. How can one restrict carriage returns and newlines in TextInput and
TextArea components? I tried
input_ti.restrict = \u0020-\u007F; and input_ti.restrict =
^\u-\u0019;
but no luck with those. There appears to be some sort of carriage returns or
new line characters that are getting through. Hope you can advise or send me
a link. Thanks in advance.
-- 
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
[EMAIL PROTECTED]
www.mindarc.com

---

This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged.
This information is confidential information and is intended only for
the use of the individual or entity named above. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.

---
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Re: [Flashcoders] Restrict textarea

2006-05-12 Thread Jonathan Berry

Users are copying and pasting from a command line program and we are getting
some special characters that are coming through.

On 5/12/06, Matthew Simpson [EMAIL PROTECTED] wrote:


Jonathon,

I'm not sure I understand...A user is inputting the special characters as
they type?

Matthew


---
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com