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:

enter image description here

有帮助吗?

解决方案

Here's one way to do what you want:

on createDigits
  set the defaultStack to "BB"
  create button "test"
end createDigits

其他提示

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top