Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
Vdig Xtra for Windows by Abstract Plane
Moving Bevel Light-Alphamania
Find out which cast members use a given font
ChromeLib
Flash Component Label
DisplayMode Xtra
WebCamXtra - Computer Vision & Camera Tracking
RadioGroup
PC Guard for Win32 Xtra
Flashation Flash Menu Builder
MediaMacros Xtras Mall
 

 

 

Behavior Home, End, Page Up, Page Down with Text Members

Added on 12/29/2005

 

Compatibilities:
behavior D8_5 D9 Mac PC Shockwave

This item has not yet been rated

Author: Chunick (website)

This behavior script can be attached to a field or text member. It will allow the user to use the Home, End, Page Up, and Page Down keys as they were intended when editing a text/field member.

property spriteNum, pSprite, pMem

on beginSprite me
  pSprite = sprite(spriteNum)
  pMem = pSprite.member  
end

on keyDown me
  Case the keyCode of
    115: -- Home  
      aChar = pMem.selection
      theLocV = pMem.charPosToLoc(aChar[2] + 1)[2]
      theChar = pMem.LocToCharPos(point(0, theLocV)) - 1
      pMem.selection = [theChar, theChar]
      
    119: -- End
      aChar = pMem.selection
      theLoc = pMem.charPosToLoc(aChar[2] + 1)
      theChar = pMem.LocToCharPos(point(pMem.width, theLoc[2])) - 1
      if pMem.char[theChar] = " " then theChar = theChar - 1
      pMem.selection = [theChar, theChar]
      
    116: -- Pg Up
      pMem.scrollTop = max(0, pMem.scrollTop - pSprite.height)
      
    121: -- Pg Down
      pMem.scrollTop = min(pMem.height - pSprite.height, pMem.scrollTop + pSprite.height)
      
    otherwise
      pass
      
  end Case
end

 


Upload Provided by ABCUpload ASP

Contact

MMI
22 West Court Sq
Suite 2C
Newnan, GA 30263
USA

Fax - (206) 339-5833

Send e-mail