Contents
Articles
Behaviors
Books
Director News
Director Web Sites
FAQ
Games
Mailing Lists
News Groups
Project Examples
Reviews
Software
Tools
Useful Web Sites
Utilities
Xtras

Don't miss these
Increase/ Decrease ViewScale Property of a Flash Member
Setup Anim
Set Stroke properties
Jaw Wars
Director Publications
myWindow
Cut, Copy, Paste behavior 1.1
Vector Shape - Create Saw Wave
Color Dialog behavior
Connect 4
 

 

 

Behavior Limited Text Behavior

Added on 9/8/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: KurtKoenig (website)

Drop this behavior on a field to make it editable. This behavior counts the number of words, entered in the editable field, and displays an alertmessage if the number of words, specified by the author is exeeded. enter the number of allowed words and your custom alertmessage in the parameterdialogbox, in it, you can also change some fontproperties .

Download PC Source    Download Mac Source
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
--
--  Drop this behavior on a field to make it editable.
--  This behavior counts the number of words, entered in the editable field,
--  and displays an alertmessage if the number of words, specified by the
--  author is exeeded. enter the number of allowed words and your custom
--  alertmessage in the parameterdialogbox, in it, you can also change some
--  fontproperties .
--
--      Kurt Koenig * Belgium.                 --        Director 7        --
--                                             --        Director 8        --
--
--  
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
property pLimitedField, pTSMember, pWordCount,¬
pAlert, pTheFontSize, pTheFontStyle



on getPropertyDescriptionList me
  
  desclist = [:]
  addprop desclist, #pWordCount,[#comment: "How many words¬
are allowed in this field ?",#format: #integer, #default:"10"]
  addprop desclist, #pAlert,[#comment: "Enter an alertmessage¬
to display if exeeded ",#format: #string, #default:"Explain¬
it in 10 words or less please !"]
  addprop desclist, #pTheFontSize,[#comment: "Fontsize to use :",¬
#default:12,#format:#integer,#range:[#min:9,#max:96]]
  addprop desclist, #pTheFontStyle,[#comment: "Fontstyle to use :",¬
#format: #symbol, #range : [ #plain, #bold, #italic], #default: #plain ]
  
  return desclist
end getPropertyDescriptionList

on getbehaviordescription
  return¬
"This behavior determines how many words"&return&"¬
an editable field allows, and displays an"&return&"¬
alert if the number of words, specified"&return&"¬
by the author is exeeded..."&return&return&"¬
   Kurt * Belgium"
end getbehaviordescription

on getBehaviorTooltip me
  return "¬
"This behavior determines how many words"&return&"¬
an editable field allows, and displays an"&return&"¬
alert if the number of words, specified"&return&"¬
by the author is exeeded..."
end getBehaviorTooltip

on beginsprite me
  pLimitedField = sprite (me.spritenum)
  pTSMember = pLimitedField.member
  pTSMember . editable = true
  pTSMember . autoTab = TRUE
  pTSMember. fontsize = pTheFontSize
  pTSMember . fontstyle = pTheFontStyle.string
  
end beginsprite


on exitframe me
  if pTSMember. words . count <= pWordCount then
    nothing
  else
    if  pTSMember. words . count > pWordCount then
      delete pTSMember. word[(pwordcount + 1)]
      Alert pAlert
    end if
  end if
end exitframe

 


Contact

MMI
36 South Court Sq
Suite 300
Newnan, GA 30263
USA

Send e-mail