User Tag List

Results 1 to 6 of 6

Thread: Copy to clipboard do not work on Html5?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    warlords's Avatar
    Join Date
    Oct 2011
    Location
    Denmark
    Posts
    665
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Copy to clipboard do not work on Html5?

    I was wondering why, since you can do it php and on a browser!

    Is there another way out, and extension or something?

  2. #2
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,532
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    I think it was not implemented originally because at that time it was not working on some browsers and/or you needed to implement this in an input event (like button click or key event) to avoid confirmation message boxes. I'll check it.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Hristos's Avatar
    Join Date
    Jul 2006
    Location
    Makrygialos, Greece
    Posts
    170
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    I am trying to use "Send text to clipboard" action of the Special Object and it does not function.
    I will try to use the document.execCommand("copy") method in a function that will be triggered on user click. but it would be nice to have this feature in HTML5.
    Is this possible?



  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export Module
    Chaos's Avatar
    Join Date
    Aug 2006
    Location
    Burnsville, MN, USA
    Posts
    807
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    @yves - has this issue been resolved at all? Or has anyone else discovered a work around? Need to be able to send text to clipboard in an HTML5 export.

    Thanks,
    Chaos

  5. #5
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,330
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    You might be able to call a Javascript function from your html page sending the text you want to send to clipboard.

  6. #6
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    14,532
    Mentioned
    279 Post(s)
    Tagged
    3 Thread(s)
    Ah yes, I forgot about this. Yes you can use a Javascript function. I quickly searched for some solution and you can do this:

    1. Add the following code to your HTML file:

    Code:
    	<script>
    		function CopyToClipboard(text) {
    			if (navigator.clipboard) {
    				navigator.clipboard.writeText(text);
    			} else {
    				var elt = document.createElement("textarea");
    				elt.value = text;
    				elt.style.position = "fixed";
    				elt.style.top = "0";
    				elt.style.left = "0";
    				document.body.appendChild(elt);
    				elt.focus();
    				elt.select();
    				document.execCommand('copy');
    				document.body.removeChild(elt);
    			}
    		}				
        </script>
    2. In your MFA add a HTML5 object, and call the CopyTextToClipboard function like this:

    HTML5 : Reset Parameters
    HTML5 : Add String Parameter "random text to copy"
    HTML5 : Call Function "CopyToClipboard"

    Note: as I said above I *think* you can do this only from a user input event, e.g. User click condition and/or Button click condition.

    Note 2: we'll implement this function in a future update.

    EDIT: I tested it on latest versions of Firefox, Chrome, Edge and Opera. Not tested on Safari. In theory it should work on older browsers too.

Similar Threads

  1. html5 next frame not work
    By orlirokra in forum Fusion 2.5 Free Version
    Replies: 1
    Last Post: 10th January 2018, 09:32 PM
  2. How the HTML5 exporter work?
    By Sevennemesis in forum HTML5 Export Module 2.5
    Replies: 24
    Last Post: 6th June 2016, 12:08 PM
  3. When I copy a eneime their events don't work.
    By Bluemilkao in forum Fusion 2.5
    Replies: 3
    Last Post: 4th January 2016, 11:35 AM
  4. Copy Text/String to Clipboard?
    By N64Mario in forum Fusion 2.5
    Replies: 2
    Last Post: 19th January 2015, 08:01 PM

Posting Permissions

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