July 29, 2020
Help with Javascript / advanced action to avoid parameter input every time
Comments
(8)
July 29, 2020
Help with Javascript / advanced action to avoid parameter input every time
Newbie 2 posts
Followers: 1 people
(8)

For every slide, I have a layer named “circle_number” and a layer named “error_number” where “number” is assigned by Captivate. Let’s say there is a clickbox on the stage: “click_box_number”, again “number” assigned by Captivate.

Is there a way to implement an advanced/shared action or javascript so that I do not have to fill out parameters on each and every slide?

For example, in English-script (I don’t know javascript)

var MyCircle = circle_number;

var MyError = error_number;

var MyClickbox = click_box_number;

if MyClickbox is hit (

show “MyCircle” and “MyError”

);

Thanks!

8 Comments
2021-11-30 05:27:54
2021-11-30 05:27:54

thank you for the js, its a start

Like
2020-08-19 18:46:38
2020-08-19 18:46:38

Thanks Paul.

I have a shared action assigned to the click_box with several parameters including one to show a circle. Then I would duplicate the slide.

I discovered that the problem is that I was not properly maintaining each timeline item that was required (as set by the shared action).

For example, I may have copied a circle_ timeline item from another slide for placement purposes, and deleted the duplicated one. In doing so the shared action that was assigned to the click_box would be reset to “Continue” because it could no longer find the circle_ with the Parameter Value it was looking for.

Makes perfect sense!

 

Like
2020-08-03 21:20:00
2020-08-03 21:20:00

Without more information really hard to help you. Since you talk about ‘click boxes’ I may suspect that you are busy with a non-responsive project because click boxes are not compatible with fluid boxes. You talk about ‘parameters’ but I don’t think you mean the parameter as defined in shared actions?

Most seemingly complicated workflows can be simplified if you think out of the box. You want to ‘show’ two items (circle and text).  However that can be replaced by changing the state in a multistate object, where each state has both the circle and the text.  You can time that multistate object for the rest of the project, so that it is available on each slide.  Have no idea how the variable is defined for each slide, or is it a random number? If you ever could post answers to those questions… there may be a very easy way to achieve your goal.

Like
(2)
(2)
>
Lieve Weymeis
's comment
2020-08-19 18:53:11
2020-08-19 18:53:11
>
Lieve Weymeis
's comment

Thanks Lieve.

Yes, it is a non-responsive project. The parameters I was referring to are ones set in a shared action assigned to the click_box (forgot to mention that).

Yes there is an easy way, and it has to do with maintaining my duplicated timeline items. (see my other post in this thread)

I will experiment with your multistate object suggestion as well.

Thanks again!

 

Like
>
huh_what
's comment
2020-08-19 19:49:11
2020-08-19 19:49:11
>
huh_what
's comment

After many experiments with shared actions I learned that they need an other approach when preparing. Often I see shared actions which are just a conversion of an advanced action which works fine. I tried to explain such a different approach in one blog as an example.  Maybe such an example can explain better than many words what I try to explain:

http://blog.lilybiri.com/tips-and-tricks-advanced-to-shared-action-intermediate

I rarely use Show/hide actions, whenever possible will use multistate objects. Goal for shared action is to make them as flexible as possible and to limit the amount of parameters which can often be done by thinking out of the box. Especially the non-compulsory parameters (variables and literals) need reflection time. Grouping (for non-responsive project) are important as well.  Several developers asked me already to offer a workshop for that type of conversion, but wonder if it would appeal?

Like
2020-07-30 01:46:51
2020-07-30 01:46:51

One of the advantages of shared actions is that you can copy and paste slides that contain them and end up with uniquely renamed variables, and advanced actions. I use this all the time to copy one of my custom question slides into a new project. Everything comes over but the magic really only works from one project to another. Duplicating slides tend to reuse the same variables and messes things up. Your example is a little vague so I’m sorry if that doesn’t answer the question for you.

Like
(2)
(2)
>
Paul Wilson
's comment
2020-08-19 18:56:14
2020-08-19 18:56:14
>
Paul Wilson
's comment

Hi Paul. I was logged out, and then inadvertently pasted my response into the wrong field, so my response to you is above.

Like
>
huh_what
's comment
2020-08-19 20:22:23
2020-08-19 20:22:23
>
huh_what
's comment

Yeah, there is still some integrity that needs to be maintained. The good news is that you can click on the {P} icon to point your shared actions at alternative objects, and variables on the new slide. As Lieve said, there sometimes is little value to a shared action if you end up having to modify everything over and over again. To give you an example of how I might use them. I might create a custom quiz question slide. With Shared actions, I can duplicate that slide that only uses shared actions dozens of times and create a whole mess of question slides without having to reprogram them. I just need to change the text for the question stem and answers. Anything more complicated than that I likely just use advanced actions and unique variables.

Like
Add Comment