How to change menuItem of pulldown on other card

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

How to change menuItem of pulldown on other card

Post by sphere » Mon Jan 12, 2015 11:41 am

Hello,

this seemed easy to me but i get an error.

I have 2 cards in a stack and on each card is the same button.
But if a selection of that button on card 1 is made then the button on card 2 should also be set to the same choice, because else if you switch to the other card the wrong choice would be displayed in the button.
But i got an error saying Chunk:can't select an object that isn't open.

Code: Select all

select menuItem 1 of button "Language" of card 2
So a same kind of code is in the button of card 2 but then pointing to the button on card 1

Thanks for any help on this.

Jerry

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: How to change menuItem of pulldown on other card

Post by jmburnod » Mon Jan 12, 2015 11:54 am

Hi Jerry,
If I undertand you correctly,it sound like you need a group "backgroundBehavior" = true and "shared group" to true.
Try this:
Create un pulldown menu
Select it with pointer tool
Group
set the "backgroundBehavior" = true and "shared group" to true
set the script of pulldown btn to:

Code: Select all

on menuPick pItemName
   set the label of me to pItemName
end menuPick
Make a new cd
Play with pulldown btn
Best regards
https://alternatic.ch

sphere
Posts: 1145
Joined: Sat Sep 27, 2014 10:32 am

Re: How to change menuItem of pulldown on other card

Post by sphere » Mon Jan 12, 2015 12:12 pm

Thank you jmburnod!
Works like a charm!

Kind regards,
Jerry

Post Reply