Reputation: 151
I want to create button to another stack with code
I have two stack.And Stacks name is "AA" and "BB"
I want to create button in stack "BB" from stack "AA" with my code
on createDigits
create button "test" of stack "BB"
end createDigits
Results: It's create in stack name "AA" and this error message:
Upvotes: 0
Views: 210
Reputation: 146
What Mark said.
The "create" command only works on the current card. You therefore have to navigate to that card in order to use the command. Mark used the "defaultStack" command to navigate to the target stack. You could also:
lock screen.
go stack "BB".
create button "test".
go back
That sort of thing.
Craig Newman
Upvotes: 1
Reputation: 2435
Here's one way to do what you want:
on createDigits
set the defaultStack to "BB"
create button "test"
end createDigits
Upvotes: 1