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
Wait for cuePoint behavior
QuickDraw 3D
MPEGXtra
cXtraTransitions
Mastering Macromedia Director 6
Fading Rollover
Sprite Works
Check For Previous Open
Draw a line with lingo
Copy Keydown Script
 

 

 

Behavior Get the default fixedLineSpace from a text member

Added on 8/3/2005

 

Compatibilities:
D8 D8_5 D9 Mac Parent PC

This item has not yet been rated

Author: Chunick (website)

It's impossible to get the fixedLineSpace of a text member if the line space was set to default. What gets returned is 0 doesn't help. This script will return the default fixedLineSpace value so that you can then use it for whatever purposes. This works great for making an advanced text editor. All you need to do is pass it a member and a character (preferrably the character the selection carat is on or the first value of the selection property). For example: theSel = member("text").selection defaultLineSpace = getDefaultFixedLineSpace(member("text"), theSel[1] + 1)

on getDefaultFixedLineSpace (theMem, theChar)
  theRef = theMem.char[theChar].ref
  theField = new(#field)
  theField.text = theRef.text & RETURN
  theField.font = theRef.font
  theField.fontSize = theRef.fontSize
  theLineHeight = theField.lineHeight - 1
  theField.erase()
  return theLineHeight
end

 


Contact

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

Send e-mail