Copy link to clipboard
Copied
Working in a Captivate course that was developed, and worked properly, in Captivate 8, then opened in Captivate 9.0.2.421 -
I have a variable (myVar - Initial value = 0), and a conditional advanced-action that tests it and performs an action.
The Action is:
Condition: If myVar not equal to C
Action: Assign myVar with S
The Issue:
In Captivate 8 this action worked just fine, with myVar set to an initial value of 0 (that is, zero). Now, in Captivate 9, this same action does not work any longer.
My Workaround:
I went into Project > Variables and updated the variable named myVar to have an initial value of A. With that one change, everything now works again.
My Question:
What gives? Why should I need to employ this workaround? I mean in Captivate 8, the initial value of 0, tested versus the value of C worked fine. Is it a Numeric character versus Alphabetic character thing? Did the update to version 9 change the way variables or advanced actions work? This is not critical because I have it working, but now I need to retrain my designers to change their variables for this action from a value of 0 to a value of A.
What am I missing here?
Copy link to clipboard
Copied
It could be that they have coded 0 = false and 1 = true throughout the window.
I know that many of CP internal variables work this way. You don't need to give it an initial value.
It could be a bug, or it could be a case of falsy or truthy:
Copy link to clipboard
Copied
I didn't have that experience and I do use a lot of variables in my project. The only issue that I remember from 8 was the concatenation of numbers, if you didn't give the variable a default value of 0 to identify it as a number. Problem was for HTML output, not for SWF.
If I understand your question correctly, don't get it completely (am not a native English speaker) it looks like something similar. It is too bad that CP doesn't let you identify a variable to be a number or string, but sometimes this can be an advantage as well.
Because I have upgraded projects without having your problem, I am just puzzled but wanted to add this comment. In many cases you do not need to give a default value to a variable, I just got used to give a default value of 0 for variables like a counter that will always have a numeric value.
Copy link to clipboard
Copied
Great responses from both Lilybiri and TLCMediaDesign. It could be a truthy falsey thing, but I'm not sure exactly how Captivate is handling the initial value of the numeric 0.
My intent is really just to document it. The fix, as indicated above, was to change all values in the variable to alpha characters. The advanced action has already been rebuilt and I'm updating my team's templates so that the designers don't need to mess with this.
I did not test the opposite situation of changing all the values to numeric information only. That might work as well.
Copy link to clipboard
Copied
In JavaScript you cannot strictly datatype a variable like you can in ActionScript.
In HTML5, CP has a function called cp.ho that checks whether the variable is a string or is not a number.
I didn't actually create an action to evaluate the variables I set , but in JavaScript:
1 == "1" = true;
1 ==="1" = false;
Perhaps Adobe changed the function in CP9 and are trying to datatype the variable, or it could be a bug in the evaluation.