Skip to main content
Participating Frequently
June 3, 2020
Answered

Conditional Statement Behavior

  • June 3, 2020
  • 1 reply
  • 1598 views

I am trying to execute a script (non-Java) and the conditional syntax is tripping me up.

 

I have a button with multiple conditional tabs that I want to play based on the status of a user variable. The Only thing I place in the Conditional tab is an IF for that variable.  The THEN section is all my actions, ending with assigning a new status to my variable.

 

My problem is that no matter what I do, the only tab that runs is the second tab.  All 5 tabs function individually, but only when they are placed in the second slot SEE EDIT BELOW, and regardless of the status of my variable.

 

I suspect that is has something to do with the lack of an ELSE statement, but the only ones that seem applicable are "continue" and "pause", and I have tried both of those without success. The variable is a simple integer that is applied based on which of four buttons on the screen is clicked. I am essentially attempting to recreate an accordion interaction from scratch with custom graphics, so the variable is necessary to know which accordion tab is open.

 

It seems like my tabs should be pretty simple: IF <variable> = 0, execute tab 1 and assign <variable> as 1.  If <variable> = 1, execute tab 2 and assign <variable> as 2.  But as I said, it just plays the second tab over and over on every click. SEE BELOW

 

Any ideas what I am doing wrong?

 

EDIT: My description is slightly wrong after further testing. I cut the decisions down to just three tabs to do some tests. In no case can I get the left (first?) condition to activate. In certain configurations I can make conditions 2 & 3 activate. In certain configurations, only 3 activates. This is blowing my mind. I added a text box to display my variable to ensure that the variable was being assigned properly and it is.  These are not complex actions, either.  It is a combination of showing and hiding elements and running simple entry animations.

This topic has been closed for replies.
Correct answer Lilybiri

Probably a logical bug. Please  post a screenshot of at least part of the advanced actions using the PREVIEW window. You open it using the first button (arrow) in the top right control panel in the Advanced Actions dialog box.

Why do I suspect a logical bug? Because lot of users ignore that, contrary to a programming language like JavaScript and Java (last cannot be used in Captivate) you cannot 'stop' the execution of the advanced action when a correct condition is reached. All decisions (each with a condition) will be done in sequence. Since you are changing the value of the variable within a condition, that could lead to overriding previous decisions. It has been quite a while that I demonstrated this problem in an old post, with an example which is still SWF-based:

http://blog.lilybiri.com/blog-after-posterous-clickclick

1 reply

Lilybiri
LilybiriCorrect answer
Legend
June 3, 2020

Probably a logical bug. Please  post a screenshot of at least part of the advanced actions using the PREVIEW window. You open it using the first button (arrow) in the top right control panel in the Advanced Actions dialog box.

Why do I suspect a logical bug? Because lot of users ignore that, contrary to a programming language like JavaScript and Java (last cannot be used in Captivate) you cannot 'stop' the execution of the advanced action when a correct condition is reached. All decisions (each with a condition) will be done in sequence. Since you are changing the value of the variable within a condition, that could lead to overriding previous decisions. It has been quite a while that I demonstrated this problem in an old post, with an example which is still SWF-based:

http://blog.lilybiri.com/blog-after-posterous-clickclick

Lilybiri
Legend
June 3, 2020