Page 1 of 1
Navigating cards using buttons in a background group.
Posted: Mon Feb 07, 2011 7:03 pm
by Tom4c
Hello,
I'm trying to set up a window (stack) with a navigation bar of 3 buttons down the left hand side, allowing me to change between the stack's cards. I have created the buttons (1,2,3), the button's group, and the cards(1011,1012,1013). I have made the group "behave like a background". For the button code I have used
where n is the card number. Buttons 2 and 3 work happily, but the first button refuses to call card 1. I have deleted and recreated the button, but this makes no difference. The button is identical in code and construction to buttons 2 and 3. Does card 1011 have any special properties? Do I need to close a card before I open the next?!
Many thanks for any help.
Re: Navigating cards using buttons in a background group.
Posted: Mon Feb 07, 2011 7:17 pm
by doc
Hi Tom,
I ran into the same issue here on my end... never noticed that before one way or another, so I don't know why.
...but this should work for ya:
Code: Select all
on mouseUp
--go to card "Card1" --->Does not work
go to card 1 --->This is okay
-- or
go to the first card --->This is okay
end mouseUp
-Doc-
Edit to note:
My cards all use distinctive names as Klaus described below. Added a sample file for clarity.
Re: Navigating cards using buttons in a background group.
Posted: Mon Feb 07, 2011 7:17 pm
by Klaus
Hi Tom,
question is, does that card really have the ID 1011???
You can check this in the "Inspector" for that card!
And what do you mean by: ...first button refuses to call card 1?
You mean clicking that button does not take you to your "first" card?
What does happen instead? Do you get any error?
I would recommend to give your cards meaningful NAMES and use these for navigation.
Hint, when you "go" to a card, there is no need to "close" the one you left!
Best
Klaus
Re: Navigating cards using buttons in a background group.
Posted: Mon Feb 07, 2011 7:50 pm
by Tom4c
Hi Guys,
Thanks for the quick posts - much appreciated! I've since renamed the cards using the "Property Inspector" and used the card names in the button code, rather than call the card ID. This now works perfectly.
How did this happen? I guess I must have edited the name of the card at some point, incrementing its number?! That's a hard mistake to spot. In the "Application browser", and the "Property Inspector > Selection menu > Inspect > Card", the given card names are the names (which originally default to the IDs), not the official card IDs. The official card ID can only be viewed in the title bar of the "Property Inspector". I recreated a stack from scratch and repeated the process, which seems to have worked fine.
Many thanks once again,
Tom.
Re: Navigating cards using buttons in a background group.
Posted: Tue Feb 08, 2011 12:05 pm
by Klaus
Hi Tom,
please check the stacks here:
http://www.runrev.com/developers/lesson ... nferences/
Great resources!
Best
Klaus