Highlighted

How do I have an object flash until the user clicks a button

Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

I have a screen simulation where an object flashes until the user clicks a button.  We hope they'll do that pretty quickly but in case they don't we need it to continue flashing until they do.  Any ideas will be appreciated.  Can this be done with an advanced action?

Thanks in advance,

Susan

Sounds like a use case for a 'While' loop in an Advanced Action.
Create two object states for your flashing object to represent Flash_on and Flash_off.

Create a User Variable - say v_isFlashing - and give it a default value of 1.

Create an Advanced Action, check 'Conditional Tab', select 'While' from the 'Perform actions:' drop-down list, and set the condition of v_isFlashing == 1.

Under 'Actions', have your flashing object repeatedly change states between Flash_on and Flash_off, with 'Delay Next Actions By' command in between.

Run this action on Slide Enter.

Have your button assign the value 0 to v_isFlashing.

The script will be looped and executed repeatedly about every second and keep the object flashing as long as v_isFlashing has the value 1. It will stop flashing when the value 0 gets assigned, which happens on click of the button.

Play with the ' Delay Next Actions By' values to make it loop seamlessly.

TOPICS
Advanced, Advanced actions, Editing

Views

348

Likes

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

How do I have an object flash until the user clicks a button

Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

I have a screen simulation where an object flashes until the user clicks a button.  We hope they'll do that pretty quickly but in case they don't we need it to continue flashing until they do.  Any ideas will be appreciated.  Can this be done with an advanced action?

Thanks in advance,

Susan

Sounds like a use case for a 'While' loop in an Advanced Action.
Create two object states for your flashing object to represent Flash_on and Flash_off.

Create a User Variable - say v_isFlashing - and give it a default value of 1.

Create an Advanced Action, check 'Conditional Tab', select 'While' from the 'Perform actions:' drop-down list, and set the condition of v_isFlashing == 1.

Under 'Actions', have your flashing object repeatedly change states between Flash_on and Flash_off, with 'Delay Next Actions By' command in between.

Run this action on Slide Enter.

Have your button assign the value 0 to v_isFlashing.

The script will be looped and executed repeatedly about every second and keep the object flashing as long as v_isFlashing has the value 1. It will stop flashing when the value 0 gets assigned, which happens on click of the button.

Play with the ' Delay Next Actions By' values to make it loop seamlessly.

TOPICS
Advanced, Advanced actions, Editing

Views

349

Likes

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
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

Sounds like a use case for a 'While' loop in an Advanced Action.
Create two object states for your flashing object to represent Flash_on and Flash_off.

Create a User Variable - say v_isFlashing - and give it a default value of 1.

Create an Advanced Action, check 'Conditional Tab', select 'While' from the 'Perform actions:' drop-down list, and set the condition of v_isFlashing == 1.

Under 'Actions', have your flashing object repeatedly change states between Flash_on and Flash_off, with 'Delay Next Actions By' command in between.

Run this action on Slide Enter.

Have your button assign the value 0 to v_isFlashing.

The script will be looped and executed repeatedly about every second and keep the object flashing as long as v_isFlashing has the value 1. It will stop flashing when the value 0 gets assigned, which happens on click of the button.

Play with the ' Delay Next Actions By' values to make it loop seamlessly.

Likes

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
Reply
Loading...
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

I must be doing something wrong.  Here is what I built from the directions above.  In the properties panel for the button to stop the loop I've assigned 0 to v_isFlashing.

 

AA_Loop.jpg

Likes

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
Reply
Loading...
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

Hhm, works for me.

Do you run the 'Loop' Advanced Action on Slide Enter? Sorry, looks like I initially failed to mention that in my previous post. Corrected now.

Likes

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
Reply
Loading...
Jan 21, 2020 0
Most Valuable Participant ,
Jan 21, 2020

Copy link to clipboard

Copied

Example, action triggered by On Enter event of the slide. Each cycle in the process takes some time to restart, hence the delay of 1 sec. Default value of v_flash == 1

FlashAct.PNG

 

I wanted to post an alternative as well, was typing when Gaanf entered his answer. Anyway, here is another screenshot:

Flash2.PNG

The SmartShape_1 is the object which is flashing.

Likes

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
Reply
Loading...
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

I've tried all these ways and it's not working.  This is in CP2017.  Am I correct in thinking == means not equal to?

Likes

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
Reply
Loading...
Jan 21, 2020 0
Advocate ,
Jan 21, 2020

Copy link to clipboard

Copied

The  ==  would mean IS equal to where  !=  would mean NOT equal to.

Likes

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
Reply
Loading...
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

Yes I ran it on slide enter.  Just to verify the == means not equal?

Likes

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
Reply
Loading...
Jan 21, 2020 0
Advocate ,
Jan 21, 2020

Copy link to clipboard

Copied

No.

See my post below.

Likes

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
Reply
Loading...
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

Thanks.

 

Likes

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
Reply
Loading...
Jan 21, 2020 0
Engaged ,
Jan 21, 2020

Copy link to clipboard

Copied

The Flicker option only flickers a few times then stops.  I need it to continue flickering until the button is pushed.  So did the loop option.  ???

Likes

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
Reply
Loading...
Jan 21, 2020 0
Lilybiri LATEST
Most Valuable Participant ,
Jan 23, 2020

Copy link to clipboard

Copied

You must have something awry, I tested both solutions in an example file.

Likes

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
Reply
Loading...
Jan 23, 2020 0