Card id and button problem
rcozens at pon.net
Tue Jun 29 18:35:35 CDT 2004
>the button that creates the new card in the drawer stack looks like this
> open stack "buttons" -- this is a substack that contains the
>buttons I use
> copy btn id xxxx to stack "MainStack" -- this is now in front of
>(and thus hides) the "new card" button
According to the Rev Dictionary (Copy), "if stack is specified, the
copied object must be a card"
so you need to
"copy button id xxxx to card [cardReference] of stack "Main Stack"
"put it into newButtonId" -- it contains new button id
> close stack "buttons"
> open stack "Y" -- this is the drawer stack
> create card
set the drawerCardId of button id newButtonId of card
[cardReference] of stack "Main Stack" to it -- it contains new card id
>So far it all works. The button on the main stack card that should
>lead back to this drawer card is:
> drawer stack "Y" at bottom aligned to center
> go card id zzzz of stack "Y"
>Is it possible to take the short id of the new drawer card and put
>it in place of the zzzz in the button script on that specific card
>in the main stack? This is what I don't know how to do.
go card id zzzz of stack "Y"
go to card id (the drawerCardId of me) of stack "Y"
in the script of button id xxxx of stack "Buttons"
This logic does not require any change to the script of the new button.
CCW, Serendipity Software Company
"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."
from "The Triple Foole" by John Donne (1572-1631)
More information about the use-livecode