I must be missing something
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
I must be missing something
I have created a mainstack and a substack. They work together as intended. The problem I am having though, is that when I initially open the the project, the substack doesn't open. I have to go to the application browser and open it from there. Am I missing a simple property setting, or do I somehow need to script the opening of that substack?
Not sure this is the best way, but try
In the main stack script.
I'm still new, but I think that since its showing in the app browser it is actually open, just not showing.
Code: Select all
on preOpenStack
show stack "stackname"
end preOpenStack
I'm still new, but I think that since its showing in the app browser it is actually open, just not showing.
Hi magice,
try:
"show stack XYZ" will only set the "visible" property but not open the stack!
Best from germany
Klaus
try:
Code: Select all
on preOpenStack
GO stack "stackname"
end preOpenStack
Best from germany
Klaus
I'm new to Revolution, but my experience so far shows that using openStack or preOpenStack is probably a bad idea. That handler will be called again when you actually open the substack (or any other substack), too. This is probably not what you want to have happen.
If you put it in openCard of the main stack, then it will only happen when you initially open the main stack.
If I'm seeing the above behavior due to a misunderstanding I have on how stack scripts are executed, then perhaps someone here can correct me and explain why that is, though.
Jeff M.
If you put it in openCard of the main stack, then it will only happen when you initially open the main stack.
If I'm seeing the above behavior due to a misunderstanding I have on how stack scripts are executed, then perhaps someone here can correct me and explain why that is, though.

Jeff M.
ah k. A DOH moment for me, thanks for the catch.
Also is stated just above, it probably is a good idea to put it in cardOpen rather than preOpenStack
I've run into some wierdness with drawers due to this.
Also is stated just above, it probably is a good idea to put it in cardOpen rather than preOpenStack
I've run into some wierdness with drawers due to this.
Klaus wrote:Hi magice,
try:"show stack XYZ" will only set the "visible" property but not open the stack!Code: Select all
on preOpenStack GO stack "stackname" end preOpenStack
Best from germany
Klaus
Really ? I never heard of that or had any such problem in the years I used revolution doing any such thing. It is called once when the main stack is opened. each substack has it's own stack script. If there no such handler in the substack it will not tigger that meassage again.massung wrote:I'm new to Revolution, but my experience so far shows that using openStack or preOpenStack is probably a bad idea. That handler will be called again when you actually open the substack (or any other substack), too.
Jeff M.
I'd be interested to see a stack that did otherwise.
The preOpenStack and openStack messages pass through the hierarchy as usual when a substack is opened as well.
If you make a plain mainstack "myMainStack" and substack "mySubStack" with no controls on them and put the following in the stack script of the mainstackthen you will find that the mainstack preOpenStack and openStack messages are triggered twice each - once when the mainstack opens, and again when the substack opens - because the preOpenStack and openStack messages are not handled in the substack, then the messages pass up the hierarchy to the mainstack in the usual manner. Therefore you need to consider the message path hierarchy when making stack level handlers. Either you need to trap them in substacks where the mainstack handlers should not trigger, or, you can move the preOpenStack and openStack handlers to card 1 of the mainstack, which will mean that a substack's message will not be trapped by the mainstack stack script - it doesn't pass through all the cards, whereas by default a stack will open card 1 of that stack as it opens.
(Not a very coherent paragraph, but I hope you get what I mean.)
If you make a plain mainstack "myMainStack" and substack "mySubStack" with no controls on them and put the following in the stack script of the mainstack
Code: Select all
on preOpenStack
answer "preOpenStack triggered in mainstack"
end preOpenStack
on openStack
answer "openStack triggered in mainstack"
go stack "mySubStack"
end openStack
(Not a very coherent paragraph, but I hope you get what I mean.)