Quantcast
Channel: Adobe Community : All Content - Edge Animate
Viewing all articles
Browse latest Browse all 9897

More actions to one button

$
0
0

I want to make a pause/play button, shifting between the two symbols by clicking.

 

Does anybody know how to implement pictures instead of

the on/off html-text on the button, according to following code from Marie Goodwyn captured from her site:

http://www.edgehero.com/articles/interactivity

 

 

 

 

 

//******************************** Demo for toggle button ******************

//                                    with setVariable.                    * 

//                              by Marie Goodwyn for edgeHero              *

//******************************************************************** ******

 

 

//set the value of a Symbol variable

sym.setVariable("onOff", true);

// click event

sym.$('btn').click(function(){

          // get the variable

          var onOff = sym.getVariable("onOff");

          if (onOff == true) {

             sym.$('Ellipse').css({'background-color':'green'});

                    sym.$('btnLabel').html('Off');

                    // reset the variable to false for next click

                    sym.setVariable("onOff", false);

          }

          else {

                    sym.$('Ellipse').css({'background-color':'red'});

                    sym.$('btnLabel').html('On');

                    // reset the variable to false for next click

                    sym.setVariable("onOff", true);

          }

});


Viewing all articles
Browse latest Browse all 9897

Trending Articles