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
Direct-L
ScreenCapture
fading button on 1 sprite
123 Flash Menu
China Multimedia Union
MelixDB Xtra version 1.0 released.
New bitmap from existing member
MediaMacros
Digital Video Button Control
Macromedia Flash 5 Authorized
 

 

 

Behavior Copy and Paste inside editable fields

Added on 10/2/2000

 

Compatibilities:
behavior D7 D8 PC

Required Xtras:
Buddy API

This item has not yet been rated

Author: MediaMacros (website)

This behavior allows field members to use the Ctrl + C, Ctrl + V, and Ctrl + X commands for copy, paste, and cut. THis is not a variable, it actually writes to the windows clipboard so the data is available to other fields as well as other programs. Note- this will only work with field members, not text members and it does not function correctly in authoring mode, only in projectors.

property spriteNum

on keyDown me
  if the key = "c" and the commandDown then
    copySelected()
    dontpassevent
  else if the key = "v" and the commandDown then
    pasteSelected()
    dontpassevent
  else if the key = "x" and the commandDown then
    cutSelected()
    dontpassevent
  else
    pass
  end if  
end

on copySelected me
  thetext = the Selection
  baCopyText(thetext)
end

on cutSelected me
  thetext = the Selection
  baCopyText(thetext)
  theStart = (the selStart+1)
theEnd = (the selEnd)
  delete char theStart to theEnd of member the member of sprite spriteNum
end

on pasteSelected me
  theText = baPasteText()
  theStart = (the selStart+1)
  hiliteNum = theText.char.count
  if thestart < 1 then set theStart = 1
  theEnd = (the selEnd)
  oldText = (sprite  spriteNum).member.text
  if ilk(theText) = #string and (sprite  spriteNum).member.type = #field then
    
    put theText into oldText.char[(theStart)..(theEnd)]
    (sprite spriteNum).member.text = oldText
    hilite char theStart to (theStart + hiliteNum - 1) of member the member of sprite spriteNum
  end if
end

on getBehaviorDescription me
  describe = "This behavior allows field members to use the Ctrl + C, Ctrl + V, and Ctrl + X commands for copy, paste, and cut.  THis is not a variable, it actually writes to the windows clipboard so the data is available to other fields as well as other programs." & return & "Note- this will only work with field members, not text members and it does not function correctly in authoring mode, only in projectors."
  return describe  
end

 


Contact

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

Send e-mail