June 12, 2017 at 2:11 pm #359750
I need some help please. I’ve attached my file. Basically, I’ve got a 3 ring binder with tabs in it. I’ve dropped a transparent button over the MOD 1 tab. When I click that button, I want to hide the opened binders title page, and reveal the Module 1 page. I also want the button to move from (1004, 62) to (0,62) on the screen (the position of the “opened” MOD 1 tab. I can make all that work so far. My problem is, I want to be able to then click that MOD 1 button again, and have it hide the Module 1 page, show the binder title page, and move back to its original (1004, 62) location. In other words, act just like opening a real binder. I’m not sure how many user defined variables I need. I’m currently playing around with mod_button_location and mod_button_open_or_closed as my 2 variables. I think I’m going to need 2 because _location will help establish a condition for _open_or_closed and vice versa. My knowledge of variables is only just starting so I apologize in advance if there is some obvious solution. I kind of feel like I should be able to use the IF / ALWAYS part of actions to make it conditional. I’ve tried it, but with no success.
Can someone help me out? I’d appreciate it.
Attachments:June 12, 2017 at 2:15 pm #359758
Matthew DyerMember3 pts@mdyer6171
Just a thought, or perhaps a different way of approaching this. Would it be easier to have the button go to a different page instead of hiding the title page? To the user, they wouldn’t see the changing of the page. It would just appear as you mentioned, that the title page would be hidden. This would also allow you to have the button in the different position without having to set up a variable to make the button move. Then on the MOD 1 page, you can have that button go back to the title page.This post has received 1 vote up.June 12, 2017 at 2:25 pm #359770
I’ve thought about that. I could probably do this by just creating extra buttons and hiding/ revealing them at the appropriate times. BUT I’m also kind of hell bent at this point on FIGURING THIS OUT. You’re right, I could do something like have a button initially hidden, and then do an “OnShowShow” to reveal the second button in the new position when the reveal page showed. BUT, like I said (I’m just repeating myself at this point… sheesh.) the person who was doing this was kind of doing it that way and while it works, it’s kind of bulky for lack of a better term. If I can get it to halfway work, I want to be able to get it to ALL the way work.June 12, 2017 at 2:41 pm #359781
You only need variables if you want to move the button. But as you’re using invisible buttons you could just add a second button on the left for “Close Page 1” and make the buttons show / hide each other.
If you want to move the same button, you’d need 1 variable per chapter. Give it an initial value of “0” for closed. Add an action to set the variable to “1” (if it’s 0) else set to 0. Make this the first action on the button and add conditions to all following actions depending on whether they’re are “Open” or “Close Page 1” actions.This post has received 3 votes up.June 12, 2017 at 2:42 pm #359785
Matthew DyerMember3 pts@mdyer6171
Well, how about this idea? Something that was kind of brought up at LUC17. Have a variable set as Postion. When you first click the button, it will add +1 to the variable and run an action group that will do everything you want it to do. When the button is clicked again, it will check to see if Position is set to 1. If it is, it will run a different action group reverting everything back to the title page, button back to original position, etc., and set the variable back to 0. Essentially, the Position variable would be a kind of on/off button.This post has received 1 vote up.
June 12, 2017 at 2:46 pm #359793
- This reply was modified 3 years, 1 month ago by Matthew Dyer.
I do want to move the buttons, because it’s more complex / involved/ whatever and I want to learn how to do it. It’s only going to be hard the first time. (I hope.)June 12, 2017 at 2:46 pm #359795
Just saw you already have my approach in it. So you’d just have to make the button hide both pages (all pages) and show “Title page” If “Right” and show “Page 1” if “Left”.
You’ll need a “mod_button_location” variable for each button and add actions to each button to set all other variables to “Right” so the users can flip through the pages.This post has received 1 vote up.June 12, 2017 at 3:31 pm #359804
Here’s a sample how it can be done with the two pages. As usual when I actually start working it comes out differently than I thought in the beginning, so I’m only using one variable to store which button has been clicked.This post has received 1 vote up.
Attachments:June 13, 2017 at 11:16 am #359934
This is EXACTLY what I wanted. Now I’m just trying to figure out HOW you did it. It seems so close to what I was attempting. The Devil is in the details. Thanks!June 13, 2017 at 11:26 am #359940
Okay, I’m looking through the Mod 1 actions you used. You’ve got a OnMClkMoveTo (1004, 155) and the target of that action is Mod 2. Mod 2 is already at that location. I tried deleting that action and running it and there seems to be no difference. What am I missing?June 13, 2017 at 11:36 am #359943
The action exists to reset “Mod 2” to the right, in case “Mod 1” is clicked while “Reveal 2” is visible, i.e. while “Mod 2” is on the left.This post has received 1 vote up.June 13, 2017 at 11:38 am #359945
Gotcha! Thanks.June 13, 2017 at 10:53 pm #360022
Math NotermansMember129 pts@mnotermans5114
Noticed this thread and wanted to make my own solution based on your question. I did want to make it reusable, especially the part where to get the positions where the button needs to go. Added crossmarks in my .awt that represent those positions. You can reposition them in the .awt and they will go to the new position. To show that that works, i added 2 buttons to make both the position of the crossmarks and the order the button goes to each position random.
You must be logged in to reply to this topic.