Sending a handler problems
Posted: Mon Dec 07, 2009 3:51 am
Hi everybody!
On a card in my mainstack I put a button that sends a handler to another stack. There are (currently) two cards in the substack. If the first card is the one open when the user clicks the button, I want to hide some graphics and a field. I'll be adding more code to deal with any further cards.
I was puzzled because the "if" structure was not being evaluated as "true" even though the correct card was open. The handler was correctly executing the lines following the "end if". My theory is that clicking on the button on the mainstack brings that stack to the front, and therefore the card that receives the handler in the substack is not the "current card" because its stack is not the active stack.
Is there a way to refer to the open card of the stack that receives the handler, when that stack is not the current stack?
Is there a way to keep a substack displayed in front of the mainstack when the user clicks on the mainstack, besides opening the substack as a palette?
If I do set the substack to be a palette, will its top card then be the "current card", or will the top card of the mainstack remain the "current card" when the button on it is clicked?
on quitApp
if the name of the current card is "Mock-up" then
hide field "Welcome"
repeat with x= 11020 to 11040
hide image ID x of group "Opening Animation"
end repeat
end if
show image "Springboard.png"
enable button ID 1053
hide image ID 1060
end quitApp
On a card in my mainstack I put a button that sends a handler to another stack. There are (currently) two cards in the substack. If the first card is the one open when the user clicks the button, I want to hide some graphics and a field. I'll be adding more code to deal with any further cards.
I was puzzled because the "if" structure was not being evaluated as "true" even though the correct card was open. The handler was correctly executing the lines following the "end if". My theory is that clicking on the button on the mainstack brings that stack to the front, and therefore the card that receives the handler in the substack is not the "current card" because its stack is not the active stack.
Is there a way to refer to the open card of the stack that receives the handler, when that stack is not the current stack?
Is there a way to keep a substack displayed in front of the mainstack when the user clicks on the mainstack, besides opening the substack as a palette?
If I do set the substack to be a palette, will its top card then be the "current card", or will the top card of the mainstack remain the "current card" when the button on it is clicked?
on quitApp
if the name of the current card is "Mock-up" then
hide field "Welcome"
repeat with x= 11020 to 11040
hide image ID x of group "Opening Animation"
end repeat
end if
show image "Springboard.png"
enable button ID 1053
hide image ID 1060
end quitApp