Search content:

 

Personal Menu
Username:
Password:
Save password

Become a member

Forgot Password?

 

Don't miss these
MPEG Xtra Time Slider
MostFramesScript
Spam and Faoul language filter for shockwave
3D games online. New cosmic world of Tensoric.
Hex to integer
TaskXtra
cXtraCalendar
Check For Asset
sprite resize
Get properties in a range of castmembers
MediaMacros Xtras Mall
 

 

 

Behavior Paste Behavior (Ctrl + V)

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 = "v") : clipboardpaste me
    end case
  else
    pass
  end if
end

on clipboardPaste me
  clipBoardRef = member "clipboard temp"
  pasteClipBoardInto member "clipboard temp"
  clipBoardRef.name = "clipboard temp"
  charCount = member("Clipboard temp").char.count
  if pMemberType = #text then
    whichSelection = member(pWhichMember)Selection
    num1 = whichSelection[1]
    num2 = whichSelection[2]
    if num1 <> num2 then
      if num1 = 0 then
        member(pWhichMember)Char[1..num2] = member("Clipboard temp").text
        member(pWhichMember)Selection = [0, charCount]
      else
        member(pWhichMember)Char[(num1 + 1)..num2] = member("Clipboard temp")Text
        member(pWhichMember)Selection = [num1, (num1 + charCount)]
      end if
    else
      if num1 = 0 then
        x = member(pWhichMember)Char[1]
        member(pWhichMember)Char[1] = member("Clipboard temp")Text & x
        member(pWhichMember)Selection = [0, charCount]
      else
        x = member(pWhichMember)Char[num1]
        member(pWhichMember)Char[num1] = x & member("Clipboard temp")Text
        member(pWhichMember)Selection = [num1, (num1 + charCount)]
      end if
    end if
  end if
  if pMemberType = #field then
    num1 = the selStart
    num2 = the selEnd
    if num1 <> num2 then
      if num1 = 0 then
        member(pWhichMember)Char[1..num2] = member("Clipboard temp")Text
        the selStart = 0
        the selEnd = charCount
      else
        member(pWhichMember)Char[(num1 + 1)..num2] = member("Clipboard temp")Text
        the selStart = num1
        the selEnd = (num1 + charCount)
      end if
    else
      if num1 = 0 then
        x = member(pWhichMember)Char[1]
        member(pWhichMember)Char[1] = member("Clipboard temp")Text & x
        the selStart = 0
        the selEnd = charCount
      else
        x = member(pWhichMember)Char[num1]
        member(pWhichMember)Char[num1] = x & member("Clipboard temp")Text
        the selStart = num1
        the selEnd = (num1 + charCount)
      end if
    end if
  end if
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