I want to have some bottons inside manipulate to calculate some time consuming functions. For example the following code changes its color after the calculation of Total[Range[123456000]] is finished. I tried
Dynamic@Button["xxx", Clear[x1]; x1 = 0; FinishDynamic[];
Total[Range[123456000]];
x1 = 1/2, Background -> Dynamic[Hue[x1]]]
with success but when I want to localize the Dynamic variable x1 inside Manipulate(or DynamicModule) there is no result! For example, the following code does not work for me!
DynamicModule[{x1},
Button["xxx", Clear[x1]; x1 = 0; FinishDynamic[];
Total[Range[12345600]]; x1 = 1/2,
Background -> Dynamic[Hue[x1]]]]
Any ideas please?