Page 1 of 1

Is there a way to do this?

Posted: Wed Oct 16, 2013 8:46 pm
by shawnblc
I have two stacks.

On stack1 I have a button. Press the button on stack1 and stack1 is hidden and stack2 opens up. When stack2 is closed I'd like stack1 to become unhidden (show), but close (just close would be fine too). I'm sure there's a way to do this, just trying to wrap my head around the logic on how to script it.

Any suggestions?

Something like this: (doesn't work though)

Code: Select all

on closeStack
   show stack1 in 10 milliseconds
   close stack1
end closeStack

Re: Is there a way to do this?

Posted: Wed Oct 16, 2013 9:24 pm
by dunbarx
Hi.

Not clear to me what the sequence is. Please reread your post. Do you mean that when stack 2 closes (Is there a button on stack 2?), it hides, and stack 1 reappears? Just asking.

But in any case, have you tried, in the button script on stack 1, to (pseudocode):

close this stack --or name the stack explicitly
open the other stack --or name the stack explicitly

and the same in stack 2.

Craig Newman

Re: Is there a way to do this?

Posted: Wed Oct 16, 2013 9:30 pm
by shawnblc
dunbarx wrote:Hi.

Not clear to me what the sequence is. Please reread your post. Do you mean that when stack 2 closes (Is there a button on stack 2?), it hides, and stack 1 reappears? Just asking.

But in any case, have you tried, in the button script on stack 1, to (pseudocode):

close this stack --or name the stack explicitly
open the other stack --or name the stack explicitly

and the same in stack 2.

Craig Newman

Let's see if I can explain this again.

Code: Select all

on closeStack
   show stack for 10 milliseconds
   close stack
end closeStack
Yes, I've tried the above code and I get errors.

I've also tried and it doesn't work.

Code: Select all

on closeStackRequest
   show stack for 10 milliseconds
   close stack
end closeStackRequest


Re: Is there a way to do this?

Posted: Wed Oct 16, 2013 9:31 pm
by dunbarx
Hi again.

Rereading your post, is it that you want to hide stack 1, show stack 2, and then hide stack 2 and show stack 1 again all in a single press of the button on stack 1? The following crude code is

Code: Select all

on mouseUp
   hide stack "untitled 1"
   show stack "untitled 2"
   wait 30
   hide stack "untitled 2"
   show stack "untitled 1"
end mouseUp
But I bet I have this wrong...

Craig Newman

Re: Is there a way to do this?

Posted: Wed Oct 16, 2013 9:52 pm
by shawnblc
Thanks Craig. You led me down the right road.