How to use a button to trigger a sequence of events

Aarnout Brombacher shared this question 1 month ago
Answered

Greetings!

Please can somebody assist me with the following:

I would like to create a button which when clicked does a range of actions in sequence e.g.

1. Change boolean "a" from false to true [to make a line segment and the point at the end appear]

2. Animate and trace the point as the end of the line segment along its path [I do have a button that does this ... can I just call a button?]

3. Change boolean "a" from true to false [to make the line segment and point at the end disappear]


Note: I would really like to (a) have these events happen in sequence and (b) be able to cause the sequence to pause for a few seconds between each action.

If somebody can help me with these steps, I think I can work the rest out.

Your help will really be appreciated.

Comments (5)

photo
1

In the attachment one of (multiple) possibilities.

It's the version I prefer. It has the following principle:

It works similar to a sequencer for video, audio or MIDI with a central timer.

An animated point (I) on a segment (g) corresponds to this central timer.

This parent segment (g) can have child segments (GH) that have their own animated point (PPD). Its animation can be dependent (on I) or independent (button1). For the animated object the path parameter (value 0..1) of the point (PPD) on the parallel segment (GH) is always relevant for the animation of objects (D and button1).

The parameter of the central timer (I) can also be used to control the objects (used for a)

Additionally, it is also possible to use the position of the central timer (I) relative to the time marks (G, H) on the parent segment (g) for the control (not used in the attachment. Example: If(Distance (I,G)<0.02, <actions for pseudo event>))

photo
1

Dear Rami,

Many thanks for your kindness and care. I will study this in greater detail. But for now, to be sure I am a little baffled :-) for now ...

Just to clarify for now ... in essence, you have a core animation ... the animation of point I from E to F as it reaches different positions along its path it triggers other actions/animations. So the animation of point I is what you refer to as the "central timer"

Again, let me spend some time with this and then revert again.

photo
1

Quote: "I is what you refer to as the "central timer"

Yes.

(and his PathParameter() and xyCoordinates)

photo
photo
3

@Rami, many thanks for all you kind assistance - after some perseverance I have been able to develop the construction sequence here, with the entire sequence triggered by one click of a button. Thank you!

photo
1

Very valuable implementation. Congratulations

photo
© 2020 International GeoGebra Institute