I'm making a words remembering program with Mathematica. I almost finished it but I need to implement a dynamics to make it more beautiful.
Try the following code:
Clear["`*"]
mode = True;
p[text_] :=
Pane[Style[text, 80, Bold, FontFamily -> "Calibri"],
ImageSize -> {500, 270}, Alignment -> Center, Appearance -> None,
FrameMargins -> None],Dynamic[If[mode,
Button[Dynamic@
DynamicModule[{}, t = Clock[1, 10, 1];
If[t == 1 || Not@mode, mode = False; p["CONTEXT"],
Graphics[{Opacity@.3, Darker@Green, Rectangle[{0, 0}, {t, 1}]},
PlotRange -> {{0, 1}, {0, 1}}, ImageSize -> {500, 270},
AspectRatio -> (27/50)]]], mode = False,
Enabled -> Dynamic@mode, ImageSize -> {500, 270}],
Button[p["Press Again"], mode = True]]]
As you can see, when you press the button or let the progression bar reach its end, it will show the word "Press Again". If you click it again, it will back to the progression bar, however, the progress will be saved and continued. I would like to reset it everytime when it goes back to the progression page but I failed after tens of trails changing the position of Dynamic and other things.
So, my question is how to solve this problem and reset the progression bar everytime it goes back to this page?
Thanks very much!
BTW: I think I will post a link to my program when I've finished~ :) I consider it as quite a good one