Page 1 of 1

How to change menuItem of pulldown on other card

Posted: Mon Jan 12, 2015 11:41 am
by sphere
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

Re: How to change menuItem of pulldown on other card

Posted: Mon Jan 12, 2015 11:54 am
by jmburnod
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

Re: How to change menuItem of pulldown on other card

Posted: Mon Jan 12, 2015 12:12 pm
by sphere
Thank you jmburnod!
Works like a charm!

Kind regards,
Jerry