I have built an advanced action that uses a variable to change the state of a shape and to hide/show some links based upon the value of the variable. The advanced action is executed each time the “Continue” button is selected.
The variable (v_introCntr) starts with a value of 0 and the first action in the Advanced Action increments the variable by 1. From there I have a series of “If” statements that check the value of the variable and are supposed to execute the corresponding actions accordingly. The problem is that the only result I’m seeing is the last action…the value of v_introCntr seems to keep incrementing up until it hits 15 and then the corresponding states & hide/shows for 15 are displayed.
It’s not executing any of the other actions….I added some test variables in there just to see and they aren’t effected.
Here’s what my Adv Actions looks like:
Thanks in advance for any help you can provide. This one is driving me crazy!
Jay
I have requested in the past a <break> type action. I would love to see it in the next version of Captivate. By <break> I mean that when going along a series of conditions in an advanced action, that we can add a <break> when we have met a condition and don’t want to continue checking subsequent conditions. This would allow us to avoid using silly solutions like creating a variable just to stop checking.
A usual problem I see often on the forums is due to an important difference between a programming script and advanced actions. You cannot ‘break out’ of an advanced action, every decision and every command will always be evaluated in the strict sequence: from top to bottom and (for decisions) from left to right. Changing the sequence can sometimes fix this, as I illustrated in this very old post where a wrong sequence and/or ignorance of that behavior caused problems:http://blog.lilybiri.com/blog-after-posterous-clickclickScroll immediately down to the ClickClick example. As a trainer/coach I strongly believe you can learn most from failures and bugs….I will have a closer look later on…. have some other priorities first to do.
Hi, it looks as if the problem is in your last conditions, where you’re checking if var == 13 or var == 14. In both cases, if the condition isn’t true, you’re setting v_IntroCtr to 15. Because that condition is true the first time through, you’re forcing the variable to 15 right away. If you don’t want to check that condition when a prior condition is true, you’ll need to set another variable in each of the conditions. At the start, where you’re incrementing v_IntroCtr, also assign a variable v_done to 0 (zero). Then in each true condition, set v_done to 1. In each condition after the first one, add the condition v_done == 0. So when you hit a condition that is true, you’re setting v_done to 1 and you’re checking if the variable is still 0 in each condition. If it isn’t, because you’ve set it to 1 in a prior condition, it will skip the rest of the conditions, at least until the next time you call the action.
You must be logged in to post a comment.