Why not just save the state when the user clicks? Each click can then just
overwrite the last state.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Paul Andrews
Sent: Sunday, January 17, 2010 1:25 PM
To: Flash Coders List
Subject: [Flashcoders] Design pattern?

I am building an interface where the user updates the interface state by 
clicking buttons. When a button is clicked it changes appearance to 
indicate the state change.

For the purposes of my question imagine a button that first shows "A" 
then when clicked changes to "B", then "C" and then "D". Clicking when 
the button shows "D" moves the state back to "A".

It may be that the user clicks at "A" and keeps on clicking until they 
reach "D" - so we have a series of state changes - A->B->C->D

The only thing that needs to be known is that the final state is "D". So 
I need to save the update to "D", but not the intermediate values.

I am planning to run a timer that is reset on every click, so that when 
the timer expires, the state is saved. The timer would only then restart 
once clicking resumes. I would most likely also have a maximum "wait" too.

Is there an alternative pattern for this?

Paul


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to