Create button script won't work - why?

Mike Bonner bonnmike at
Sun Nov 14 20:50:38 EST 2010

I don't think you can direct where the button goes, the dictionary says:
     Summary: Creates a new object on the current card.
I believe you can get around this by placing a group on your card. Perhaps
with an invisible background, sized to window size.  At this point you can:
create button "Fred" in group "Testing" card "One" stack "Test"

On Sun, Nov 14, 2010 at 6:22 PM, Bill Vlahos <bvlahos at> wrote:

> Make a new stack called "Test" and label the card "One".
> Put a button on the card with the following script:
> on mouseUp
>   create button "Fred" in card "One" of stack "Test"
> end mouseUp
> The compiler doesn't complain but when I click the button I get this error:
> button "Button": execution error at line 2 (create: error in bad parent or
> background expression), char 1
> The following script works:
> on mouseUp
>   put the defaultStack into vName -- note whatever the defaultStack is
>   set the defaultStack to "Test"
>   go to card "One"
>   create button "Fred"
>   set the defaultStack to vName -- reset the defaultStack to what it was
> before
> end mouseUp
> Is there a way to directly create a button on a particular card in a
> particular stack without going to it and doing all this? The stack I want to
> create the button into is data stack that never gets viewed directly. In
> this case it will be data in the custom property of that button.
> Thanks,
> Bill Vlahos
> _________________
> InfoWallet ( is about keeping your important
> life information with you, accessible, and secure.
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:

More information about the Use-livecode mailing list