0 Replies - 1058 Views - Last Post: 01 May 2006 - 06:08 AM

#1 reyco1  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 43
  • Joined: 20-March 05

Copy & Paste

Posted 01 May 2006 - 06:08 AM

Description: This goes on a controller clip somewhere off stage. To copy click inside a text field and press Ctrl C, to paste, click the target field and press Crtl V.The code snippet everyone was looking for! Perfect copy and paste functionality in flash! Written by Jesse Stratford of Actionscript.org (http://www.actionscript.org/actionscripts_library/Selection_Object/)
/*OK so everyone's been going on about how to use the standard Windows copy
and paste keys within Flash. Well here's my solution.*/

// Win. Copy and Paste Functionality, V1
// Jesse Stratford, www.actionscript.org

onClipEvent (enterFrame) {
        if (Key.isDown(Key.CONTROL) and Key.isDown(67)) {
                if (Selection.getFocus() != null) {
                        copy = Selection.getFocus();
                }
        } else if (Key.isDown(Key.CONTROL) and Key.isDown(86)) {
                if (Selection.getFocus() != null) {
                        _root[Selection.getFocus()] = eval(copy);
                }
        }
}

/*This goes on a controller clip somewhere off stage.
To copy click inside a text field and press Ctrl C, to
paste, click the target field and press Crtl V.*/



Is This A Good Question/Topic? 0
  • +

Page 1 of 1