At 20:01 +0100 02/05/2002, Tony �str�m wrote:

>when I paste for example 200 characters into the member("Body") it went
>completey crazy. Alert,
>alert , alert , alert , alert , alert , alert , alert , alert , alert
>.............
>How can I prevent this and auto. delete the character(s) after the 150 ?

Instead of pasting directly into your 'body' member, try pasting into 
a placeholder member first (check out pasteClipBoardInto, for 
instance). Then do a char count on that or, more usefully, just take 
char[1..150] of it.

Apart from that I'm assuming your count test is happening on 
something like an exitFrame event. Thus every time the stage 
refreshes, your test runs again. Consider using a keyDown event 
instead,  which will only do the counting when text is being entered:

on startMovie
   the keyDownScript = "checkChar"
END startMovie

on checkChar
   if member("Body").text.length > 150 then
     if gLang = "eng" then
       alert "Max 150 characters. Should you need more then please state
it in your e-mail."
     else if gLang = "fra" then
       alert "Max 150 caract�res. Si vous avez besoin de plus de place,
contacter nous par E-mail."
     end if
     stopEvent()
   else
     pass
   end if
end

The above's just one idea. You might also want to (for instance) 
allow the user to press arrow keys, and delete/backspace, but skip 
the rest, when the char count is above 150.

-- 

              Warren Ockrassa | http://www.nightwares.com/
  Director help | Free files | Sample chapters | Freelance | Consulting
        Author | Director 8.5 Shockwave Studio: A Beginner's Guide
                    Published by Osborne/McGraw-Hill
          http://www.osborne.com/indexes/beginners_guides.shtml
[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to