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
Shiver With Sound
Director 7 and Lingo Bible
Lingo and Shockwave Sourcebook
Sprite Drag - Confine to stage
How do I check if a user has the needed fonts on their machine?
Check For Qt Version
Doutone-Alphamania
Amplitude Xtra
Script Database
Planet Orbiter
 

 

 

Behavior Cut Behavior (Ctrl + X)

Added on 2/15/2000

 

Compatibilities:
behavior D7 D8 Mac PC Shockwave

This item has not yet been rated

Author: Macromedia (website)

From Technote #14130 at Macromedia.com

property spriteNum, pWhichSprite, pWhichMember, pMemberType

on beginSprite me
  pWhichSprite = sprite(me.spriteNum)
  pWhichMember = pWhichSprite.member
  pMemberType = pWhichMember.type
end

on keyDown me
  if (the commandDown) then
    case (TRUE) of
      (the commandDown AND the keyPressed = "x") : clipboardCut me
    end case
  else
    pass
  end if
end

on clipboardCut me
  if pMemberType = #text then
    whichSelection = member(pWhichMember).selection
    if whichSelection[1] + 1 <> whichSelection[2] then
      put pWhichMember.selectedText.text into member("clipboard temp")
      delete member(pWhichMember).char[whichSelection[1] + 1..whichSelection[2]]
      copyToClipboard member "clipboard temp"
    else
      beep
    end if
  end if
  if pMemberType = #field then
    whichSelection = the selection
    if the selStart<> the selEnd then
      put the selection into member("clipboard temp")
      a = the selStart
      b = the selEnd
      put char a + 1 to b of the text of member pWhichMember into member("clipboard temp")
      delete char a + 1 to b of member pWhichMember
      copyToClipboard member "clipboard temp"
    else
      beep
    end if
  end if
end

 


Contact

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

Send e-mail