open a substack in an opencard handler
Posted: Mon Jul 29, 2013 11:54 pm
I am trying to have a substack open above the main stack when a card opens. What happens is the substack opens in front of the main stack but immediately the main stack moves to the front. I want the substack to stay above the main stack.
Two illustrate this I created a simple stack with a main stack with two cards and a sub stack called "window2"
Card 1 of the main stack has a button with the script
Card 2 of the main stack has the following card script
Card 2 of the main stack also has a button with the following script
When you click the button to go to card 2 the stack "window2" opens above the main stack and stays for the 2 seconds of the wait but then the main stack moves to the front.
I assume the problem is that when the opencard message ends the stack with the card with that handler becomes the active stack and moves to the front.
I have tried sending or dispatching messages to other objects to show and go to the substack but if I do that within the opencard handler after those messages are dealt with the context returns to the open card handler and then the main stack becomes active again.
Is there another way to do this?
Thanks.
Martin Koob
Two illustrate this I created a simple stack with a main stack with two cards and a sub stack called "window2"
Card 1 of the main stack has a button with the script
Code: Select all
on mouseUp
go card 2
end mouseUp
Code: Select all
on opencard
show stack "window2"
go stack "window2"
#the following wait command is just to hold stack "window2" open long enough to see it opened
wait 2 seconds
end opencard
on closecard
hide stack "window2"
end closecard
Code: Select all
on mouseUp
go card 1
end mouseUp
I assume the problem is that when the opencard message ends the stack with the card with that handler becomes the active stack and moves to the front.
I have tried sending or dispatching messages to other objects to show and go to the substack but if I do that within the opencard handler after those messages are dealt with the context returns to the open card handler and then the main stack becomes active again.
Is there another way to do this?
Thanks.
Martin Koob