Copy link to clipboard
Copied
I have a project for a client where they would like to have an HTML 5 responsive quotation calculator that will work on all platforms.
The sales team access the quotation tool from a central web address and the pricing used for the products needs to be stored in an external XML file so the client can keep that up to date directly, which is then pulled in to the CP8 quotation tool.
I'm nearly there but i've hit a sticking point that I just can't work out.
I followed this tutorial Common JavaScript Interface in Adobe Captivate 8 - YouTube and can call in my data from the XML file. If I put the variable in a Text Caption it works great.
Based on the items selected I need to add the variables together to produce a total for the quote. To do this I used this tutorial as an example Creating a Simple Calculator in Adobe Captivate 8 - YouTube which does what I need but it uses Text Entry Boxes so the user can enter their own values.
What I need help with is bridging that gap. Ideally I need to call in my XML variables directly in to Text Entry Boxes rather than Text Captions but I can not find a way of doing this that works. I have seen an SWF file for a previous version of Captivate but that will not work for me as it needs to be HTML5/iPad friendly.
Does anyone have any clues, help, suggestions please as to how you call in XML variables directly to TEB's - thanks!
Copy link to clipboard
Copied
Why does it have to be in a TEB? That interactive object, which has an associated variable, is meant to allow users to enter a value. If I understand your question correctly, you don't want to do that. Maybe you ignore that several learning interactions do have associated variables, even though they are non interactive? As long as you can store the data in a variable that is fine. One of those interactions is the Scrolling Text interaction. For calculation I would use advanced actions, but of course it works even easier with JS.
An advantage of that interaction is that you can change the value of the variable and it would show up, which is not the case when you change the value of a variable associated with a TEB.
This is not solving your problem, just a small tip.
Copy link to clipboard
Copied
Thank you for your quick reply Lilybiri, appreciated. Your right, it doesn't need to be a TEB at all, I just need some way of adding up the variables imported from the XML file.
However, there are 40 variables so using advanced actions I don't think will work as when they use the quote tool they may only select 10 variables rather than all 40 and want to generate a quote based on that.
My only reason for thinking about TEB is that I know I can add those together easily. I will have a look to see if I can find a JS solution.
Thanks again.
Copy link to clipboard
Copied
I still don't understand why you need TEB's at all?
Copy link to clipboard
Copied
I have no particular attachment to using TEB's, I really don't mind how it is done!
However if I call the variables in to Text Captions then add them together, for example 10 + 15, rather than my total being 25, I get 1015 - it just adds the variables one after the other rather than as a mathematical addition. If I use numbers in TEB's, it adds them together correctly hence my only reasoning for using them.
But, as I said, I don't have any attachment to them so if there is a way I can call in my 40 variables from an XML file, let the user put a check mark next to which every variables they wish to select, then add those selected variables together and produce a total that is exactly what I need.
Thanks!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now