A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: System.setClipboard issue

  1. #1
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389

    System.setClipboard issue

    Hi,

    I'm trying to save my text history on button click, but I'm messed up.

    It only works works once and I'd like it to keep working in case the user opts not to leave the room and prefers to save his history later.

    Besides this, nothing is saved. Where am I going wrong?

    It's going to be hard for me to explain without attaching the file here, but it is about a chat.

    Here's the code wheere I have things happening:

    Code:
    feedback_txt._visible = false;
    
    textFeedback("Text del xat copiat al portapapers!! Recorda de copiar-lo a un arxiu i tornar-lo a desar");
    
    function textFeedback(theFeedback:String) {
    	feedback_txt.text = theFeedback;
    	setTimeout(function () {
    		feedback_txt.text = "";
    		feedBack_mc.swapDepths(userList_lb);
    	}, 12000);
    }
    
    myMouse.onMouseUp = function() {
    	Selection.setFocus("input_txt");
    	exit_btn.onPress = function():Void  {
    		if (!_global.isBusy) {
    			closeConnection();
    		}
    	};
    	saveChat_btn.onRelease = function() {
    		chat_txt._visible = true;
    		Selection.setFocus("chat_txt");
    		Selection.setSelection(0, chat_txt.text.length);
    		System.setClipboard(chat_txt.text);
    		feedback_txt._visible = true;
    	};
    };
    Can anything here affect the reason why the chat isn't copied in the clipboard?

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi Cap,

    At a quick glance try removing the saveChat_btn.onRelease = function .... outside of the mouseUp function, they probably cross one another.

    probably best with the exit button too

  3. #3
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    Working better, but still no text is copied.

    Can this have to do with operating system or html code?

    I use Windows 8.1

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,780
    Hi,

    I wouldnt have thought it had anything to do with which windows you use.

  5. #5
    Senior Member
    Join Date
    Jan 2007
    Location
    Barcelona
    Posts
    389
    No worries!

    I just posted it in my site and it works http://webs.ono.com/jpdurba/xatAvata...bhistorial.swf if you 're curios...


    but it only works once

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