Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
File Read/Write
simODBCPro Xtra
Datagrip
Go to NetMovie
Drop Shaddow Animating Lame Button-Alphamania
Special Edition Using Macromedia Director 8
RGB Shifter-Alphamania
Director 8 and Lingo: Inside Macromedia Series
Digital Video Button Control
SetMouseLoc Xtra
MediaMacros Xtras Mall
 

 

 

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

 


Upload Provided by ABCUpload ASP

Contact

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

Fax - (206) 339-5833

Send e-mail