• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to use Clipboard.Js with Animate

New Here ,
Jan 25, 2017 Jan 25, 2017

Copy link to clipboard

Copied

My end goal is simply to have buttons that when clicked copy specific texts into the user's clipboard.

Clipboard.js accomplishes this quite easily on it's own, but i can figure out how to integrate it into my adobe animate html5 canvas projects. i'd like the following clipboard.js code effectively used in my animate canvas project:

    <!-- 1. Define some markup -->

    <button class="btn">Copy</button>

    <!-- 2. Include library -->

    <script src="../dist/clipboard.min.js"></script>

    <!-- 3. Instantiate clipboard -->

    <script>

    var clipboard = new Clipboard('.btn', {

        text: function() {

            return 'to be or not to be';

        }

    });

    clipboard.on('success', function(e) {

        console.log(e);

    });

    clipboard.on('error', function(e) {

        console.log(e);

    });

    </script>

...except i'd like the button that triggers the copy function to be a button on the stage of my canvas project, not a button in the html. i need to be able to put the working code in the actions panel on a keyframe in the animate timeline, not in the html wrapper.

i'm also not sure how to include libraries in the new html5 canvas projects. but i'd like to be able to do that through scripting in the actions panel as well.

i have searched, and searched, and searched. It's 5am now and i started working on this at 9pm last night. please help.

EDIT [link removed by moderator]

TOPICS
Exchange extensions

Views

783

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation