Skip to main content
Participant
October 2, 2016
Question

How change state smartshape via javascript?

  • October 2, 2016
  • 1 reply
  • 3129 views

Hello everyone!

i am using Captivate 9

How change state or properties (background color, font, size, ets.) SmartShape via javascript?

Thank you!

This topic has been closed for replies.

1 reply

TLCMediaDesign
Inspiring
October 3, 2016

My suggestion would be to create the states in CP, then if you need to change it using JavaScript use:

cp.changeState("currentState,"newState");

It can be quite tricky to manipulate the canvas elements without knowing exactly how it is constructed.

Participant
October 11, 2016

Unfortunately it doesn't work.

How do I apply a function cp.changeState("currentState,"newState"); to a specific SmartShape?

TLCMediaDesign
Inspiring
October 11, 2016

You need to know the names of the states, currentState and newState are just placeholders to show you what goes where in the arguments.

So the first parameter is the name of the element state that is currently active, the second parameter is the name of the state you want to show.