Question

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

Was it helpful?

Solution

Here's one way to do what you want:

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top