open a substack in an opencard handler

Martin Koob mkoob at rogers.com
Mon Jul 29 18:07:57 EDT 2013


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

on mouseUp
   go card 2
end mouseUp

Card 2 of the main stack has the following card script

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

Card 2 of the main stack also has a button with the following script

on mouseUp
    go card 1
end mouseUp

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



--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/open-a-substack-in-an-opencard-handler-tp4668105.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list