• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

IF/WHILE not working?

New Here ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

Hi,

I'm working on a pretty simple timer advanced action, but I haven't been having much luck.

I have my advanced action set up to the following:

First tab:

WHILE TestTimer =/= 0, decrement TestTimer by 1.

Second tab:

IF TestTimer = 0, Exit

 

I have my TestTimer variable showing on screen and that's working fine, but it doesn't exit when it reaches zero.

I've tried several variations of this, such as trying to hide/show objects based on TestTimer value within the same advanced action, but have not had any luck so far and it's really confusing me.

Views

123

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 01, 2024 Aug 01, 2024

Since you have not stated which version of Captivate you are using, I will assume it is Captivate Classic, 2019.

 

What event are you using to trigger your action?

 

If for example you are using the On Slide Enter event to trigger the action, then the action will only trigger once unless you leave the slide entirely and reenter again.  If you are triggering via clicking a button, you need to repeatedly click the button to repeatedly execute the action.

 

That's the way Captivate interactivity ha

...

Votes

Translate

Translate
New Here ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

Wait.. is Captivate only checking IF statements once, when the action is called?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 30, 2024 Jul 30, 2024

Copy link to clipboard

Copied

Just in case this was the issue, I switched to using one Advanced Action tab, just the WHILE condition.

While Timer is greater than 0, Decrement Timer by 1.

That works on its own, but I need to perform actions once it hits 0, so I added javascript action within the While loop, and that doesn't work either (timer no longer counts down - it's just a dumy JavaScript function that only calls console.log).

I'm starting to think Captivate is just broken.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2024 Aug 01, 2024

Copy link to clipboard

Copied

Since you have not stated which version of Captivate you are using, I will assume it is Captivate Classic, 2019.

 

What event are you using to trigger your action?

 

If for example you are using the On Slide Enter event to trigger the action, then the action will only trigger once unless you leave the slide entirely and reenter again.  If you are triggering via clicking a button, you need to repeatedly click the button to repeatedly execute the action.

 

That's the way Captivate interactivity has always worked.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 01, 2024 Aug 01, 2024

Copy link to clipboard

Copied

Thanks. I understand that now, but definitely wish there was a way to run if checks within a while loop. The elearning game I'm working on is kind of arcade style, so I'm trying to come up with more ways to make things continue to happen without the player clicking buttons. So, a style I don't believe Captivate was really intended to be used for.

 

I have objects shooting across the screen using animations, but haven't found a good way to account for them actually reaching the other side and was wanting to do everything on a single slide. I've adjusted my expectations at this point.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 02, 2024 Aug 02, 2024

Copy link to clipboard

Copied

LATEST

You are correct that Captivate was not really designed to accommodate the kind of advanced game-based animation and interactivity you were hoping for.

 

If you are an advanced user of Adobe Animate, it is possible to build your game in that environment and then bring it into Captivate Classic as an HTML5 OAM file.  But then to get the game to report any kind of result to Captivate for use in quizzing etc would require more JavaScript programming to achieve the integration.

 

Adjusting your expectations is the wise thing to do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources