Skip to main content
Participant
Oct 2, 2016 12:06 PM UTC
Question

How change state smartshape via javascript?

Hello everyone!

i am using Captivate 9

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

Thank you!

This topic is closed to new replies. Start a new post to keep the conversation going.

16 replies

TLCMediaDesign
Inspiring
Oct 3, 2016 12:27 PM UTC

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.

Translate
Participant
Oct 11, 2016 3:07 PM UTC

Unfortunately it doesn't work.

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

Translate
TLCMediaDesign
Inspiring
Oct 11, 2016 3:13 PM UTC

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.

Translate