A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: copy/paste/select all text button

  1. #1
    Webnews ;)
    Join Date
    Nov 2007
    Location
    Denmark
    Posts
    68

    copy/paste/select all text button

    Hey

    I am trying to make these buttons.
    1: Copy text i text felt
    2: paste text
    3: select all text

    I have made the select all text, but I don´t know how to make the copy and paste buttons..

    Here is my select all script.

    PHP Code:
    // my text felt is called txt_felt, and this script is put on a button
    on(release){
    Selection.setFocus("_root.txt_felt");

    PLEASE help.

  2. #2
    evermoving + immovable wall =?
    Join Date
    Jan 2008
    Posts
    26

    "Changing the clipboard"

    This will help you solve your problem:
    Add this to your button:
    Code:
    on (release) {
    	this.onEnterFrame = function() {
    		System.setClipboard(_root.txt_felt);
    	};
    The "System.setClipboard();" sets the clip board to whatever is inside the _root.txt_felt text box.

    Hopefully this will solve your problem.
    The full code for your button is below:
    Code:
    on(release){ 
    Selection.setFocus("_root.txt_felt"); 
    } 
    on (release) {
    	this.onEnterFrame = function() {
    		System.setClipboard(_root.txt_felt);
    	};
    }
    (P.S. I'm new here but I've had flash for a while and I stumbled upon this awesome website).

  3. #3
    Webnews ;)
    Join Date
    Nov 2007
    Location
    Denmark
    Posts
    68
    First off all THANKS fore your help, and welcome to the forum. Yes it is a great place, where people are nice.

    Maybe it is me, but I cannot make it work, is it posible that you will make the fla file to me sow that I can see what it is that you are doing.

    Again thanks fore your help.

  4. #4
    evermoving + immovable wall =?
    Join Date
    Jan 2008
    Posts
    26

    Reply

    Try putting these actions into a button that will, select, then copy and paste whatever is inside your "_root.txt_felt" textbox.

    Code:
    on(release){ 
    Selection.setFocus("_root.txt_felt"); this.onEnterFrame = function() {
    System.setClipboard(_root.txt_felt);
    }; }
    Sorry, but I'm using my laptop right now (doesn't have flash) and it's really late. Tomorrow if I don't forget, I will post a .fla for you to take a look at.

    C ya for now.

    (Also, i haven't tried this yet, but the button above only selects and copies; it doesn't paste. I'm pretty much stumped on how to make a paste button. I'm also not sure why you would need one in flash because I would only find use for a copy/select button for either a dynamic or input text box). If I find out how to make a paste button, I will post here.)
    Last edited by InteractiveBUD; 01-22-2008 at 02:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center