Skip to main content
May 9, 2016
Question

Smart Shape Attribute Modification with JavaScript? (Captivate 9)

  • May 9, 2016
  • 1 reply
  • 1201 views

Adobe's live chat didn't know the answer to my questions.

This will be the last time I am asking about this on the forums. If no one knows how to do these things, then I give up on trying to achieve this in Captivate.

For this, I need help from a Captivate/JavaScript professional.

Issue:

I need to control the attributes of smart shapes with JavaScript. I am making a game similar to memory/match.

Preview: http://i.imgur.com/nj4c2Il.jpg

Each tile's variable is randomised using JavaScript. At the moment, it's just text. I need to randomise image files onto those tiles (rather than text variables). I also need to be able to show/hide or at least control the states of the smart shapes with JavaScript.

These are the core issues I need a solution to, and not being able to find existing solutions online has been driving me crazy.

If anyone knows how to do these things, I will be forever grateful to you.

Thank you in advance.

    This topic has been closed for replies.

    1 reply

    TLCMediaDesign
    Inspiring
    May 9, 2016

    I haven't tried to change states with JavaScript, but this could be achieved by stacking smartshapes and not using states. Then you just execute cp.hide("Top shape name") in JavaScript. To reset use cp.show("Top shape name").

    May 10, 2016

    That is one way to cheat it, but over time it creates many objects on the page. I currently have the show/hide implemented (without the second shape underneath).

    Lilybiri
    Legend
    May 10, 2016

    Of course, you want JS which will offer more functionality. Long time ago, even before shared actions, I created a Memory Game only with advanced actions and variables. It would now be much easier with both shared actions and states:

    Concentration Game - created exclusively with Captivate - Captivate blog