LATEST AWESOMNESS

Opening Url on Click

While we bringing interactivity back to life many of our users need to do something simple now. Like opening an url when somebody clicks on their clip. Here is a workaround you can use now:

  • Download HTML5 code via main menu and unzip it

  • Open project.html in your favorite text editor and find there the section which looks like this

    <script type="text/javascript">
        var width = 550;
        var height = 450;
    
        var playerParams = {
            width: width,
            height: height,
            repeat: false,
        };
    
        var WRAPPER_ID = 'target';
        var wrapper = document.getElementById(WRAPPER_ID);
    
        document.body.className = 'no-iframe';
        wrapper.className = 'no-iframe';
        wrapper.style.width = width + 'px';
        wrapper.style.height = height + 'px';
        wrapper.style.marginLeft = -Math.floor(width / 2) + 'px';
        wrapper.style.marginTop = -Math.floor(height / 2) + 'px';
    
        var filename = 'project';
        var animation = {......};
    
        var player = anm.createPlayer(WRAPPER_ID, playerParams).load(animation, anm.importers.create('animatron'));
    </script>


  • Change the following parts there

    var playerParams = {
        width: width,
        height: height,
        autoPlay: true,        // THE CLIP WILL AUTO PLAY
        repeat: false,
        controlsEnabled: false // NO PLAY/PAUSE BUTTONS WILL BE SHOWN
    };
    and

    var player = anm.createPlayer(WRAPPER_ID, playerParams).load(animation, anm.importers.create('animatron'));
    
    // ADD CLICK EVENT LISTENER
    wrapper.addEventListener('click', function() {
        window.open('https://www.animatron.com');
    });

Now the clip will play right away, no controls will be shown and when clicked it will open www.animatron.com, check this out below: