Page 1 of 1

Problems with "undo" (button) for user actions.

Posted: Tue Jun 30, 2015 9:45 am
by sinep
I've been trying to make an "undo" button for some time now and only have it partially working.

I have it so that a user can clone a button (or multiple buttons) and click the "undo" button if they want to delete the last cloned button. It does delete each button in sequence of when it was created except that it CONTINUES to delete buttons that should not be deleted such as the "main page" button that returns users to the main page.

How do I make it so that it only deletes user-created buttons?

Re: Problems with "undo" (button) for user actions.

Posted: Tue Jun 30, 2015 1:05 pm
by Klaus
Hi sinep,

we need to take a look at your "delete" script! 8)


Best

Klaus

Re: Problems with "undo" (button) for user actions.

Posted: Tue Jun 30, 2015 2:58 pm
by dunbarx
Hi.

If your button does something like:

delete the last button

then how would it know when to stop? The 'last" button will be the one with the highest layer property. Period.

If you have a core set of controls, the trick is to somehow identify the cloned buttons apart from that core. You do this by setting a property unique to the cloned buttons, that is not shared by the core controls. Do you see? Can you handle this on your own? Write back if you need a clue.

Craig Newman

Re: Problems with "undo" (button) for user actions.

Posted: Wed Jul 01, 2015 3:42 am
by sinep
Thank you!

I think I'm headed in the right direction now.