Copy link to clipboard
Copied
I already had help with creating a little test with objects of different states, that can be identified with variables (https://community.adobe.com/t5/captivate-discussions/bedingte-erweiterte-aktionen-mit-mehr-als-2-sta...), I hope the next step can also be done:
Imagine an equation like:
[A] = [B] x [C]
A, B, C are objects with 3 different states (each of them: state 1 = A, state 2 = B, state 3 = C). By clicking on the objects, the states change. By clicking on "Send", the object's states shall be checked ("right" oder "wrong") - for all 3 objects at the same time.
I have tried without success to create an advanced action that allows to have either B oder C in object 2+3. The equation is correct in both forms:
A = B x C as well as A = C x B
I am curious to learn how this can be fixed. Thanks for your ideas!
If you are using the same setup as in the previous post that you mentioned, and you want the learner to click through the cards until the value equals 6, you should be able to perform a check for
myVar * myVar2 == 6
Or you need to introduce a third variable (myVar3) for the answer card and have the same setup as the other two with the incrementing variable matching the states.
Then you would check for
myVar * myVar2 == myVar3
To calculate in Captivate you need to use the Expression command. It has the four main mathematical operators.
Some examples:
Besides +, you have - * and /
I added the last line to show that calculation can be powerful: that command will skip 60 frames (2 seconds if the default 30FPS is kept) on the timeline. Check out the end of this thread, where I took advantage of that type of workflows:
...Copy link to clipboard
Copied
If you are using the same setup as in the previous post that you mentioned, and you want the learner to click through the cards until the value equals 6, you should be able to perform a check for
myVar * myVar2 == 6
Or you need to introduce a third variable (myVar3) for the answer card and have the same setup as the other two with the incrementing variable matching the states.
Then you would check for
myVar * myVar2 == myVar3
Copy link to clipboard
Copied
Copy link to clipboard
Copied
To calculate in Captivate you need to use the Expression command. It has the four main mathematical operators.
Some examples:
Besides +, you have - * and /
I added the last line to show that calculation can be powerful: that command will skip 60 frames (2 seconds if the default 30FPS is kept) on the timeline. Check out the end of this thread, where I took advantage of that type of workflows:
You are showing only the logical operators for a condition. Bit amazed that you always ask for JS whereas you didn't yet explore the possibilities of the point-and-click actions in Captivate.
Copy link to clipboard
Copied
Thank you so much! Indeed, I did not know about the "expression"-command and calculator-functions. Can you recommend a good User Guide where all these possibilities are explained? I have not found this in https://helpx.adobe.com/de/captivate/using/advanced-actions.html .
PS: What does "JS" mean? My English is not so good...
Copy link to clipboard
Copied
You can write in German, sorry that I didn't write in Goethe's language which I understand perfectly but German grammar is bit rusty. Dutch (I am Flemish) is my mother tongue.
JS = JavaScript. Captivate's advanced and shared actions are converted to JS on runtime.
The Help documentation is very limited, that was the reason I started blogging about Advanced actions in 2009 and still continue doing that. Use the tag 'Advanced action' or 'Shared action' (much more powerful) in the Search function:
You will find a lot of use cases, and the Expression command rarely is missing in the example scripts.
The Variables category Movie Control is something special, because changing a variable is in reality leading directly to an action. Download the descriptive table from this blog post:
https://blog.lilybiri.com/discover-slash-use-captivates-system-variables-part-1
Copy link to clipboard
Copied
Thank you very much! This was more help than I expected 🙂
Copy link to clipboard
Copied
I was hesitant because you wanted only JavaScript, and there are some good experts for JS here in the forum. Personally I only use it when Captivate cannot achieve what I want to do, reason why I specialized in Advanced/Shared actions. Multistate objects are for sure one of the best features added.
Copy link to clipboard
Copied
I guess I missed the part where OP requested JavaScript.
Copy link to clipboard
Copied
See reference to older post, this was meant as a follow up to that one - with JS.
Copy link to clipboard
Copied
I did look at the older post before responding to this one. It was one where I helped out as well but I did not offer a JavaScript solution nor was one requested. That is why I did not offer a JavaScript option with this thread either.
Copy link to clipboard
Copied
Hi,
your answer worked fine with a simple calculation (3 buttons), so I tried the same with 4 buttons. However, I failed...
The variables for the 4 buttons have the value "1".
Each button has an advanced action to change state and variable, I have added the screenshot of the advanced action für button "Druck_TF".
There are many right answers:
A x B = C x D
or
B x A = D x C
or
C x D = A x B
...
If the 4 states of the 4 buttons would set the variables correctly, and the "Senden"-Button would calculate properly, both sides of the "=" should be equal to "5" (1+4 or 2+3).
Any idea what I got wrong? Thanks a lot for your help!
Copy link to clipboard
Copied
Why do you use a multiplication instead of a sum of the variables?
1*4 = 4 and 2*3=6
Sorry, it is correct in the advanced action, will try to set up a project to find the logical bug.