Need help with flags

Forum to ask for any help
Post Reply
anderdea
Posts: 78
Joined: Wed Mar 07, 2018 1:19 am

Need help with flags

Post by anderdea » Sun Apr 01, 2018 6:22 pm

I’m just not getting it!
I have a subpage called “links to components” this subpage shows up fixed to the left on all my main pages which is OK. I would like however to be able to swipe from left to right on my Home Page and have the subpage appear on the left. Then swipe from right to left and have it disappear or have it disappear when I leave my home page, more preferable. I know it can be done with flags but I just can’t understand how to set up the flags and how to make it happen on my Home Page without a button. Also if I use the subpage name will that action become active on all my pages as it is common to them. I only want it to work on my Home page.

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Need help with flags

Post by DemoPad » Mon Apr 02, 2018 10:33 am

You will need to use a button. The button can be completely transparent / invisible though - there is one in the Free Graphics Set - Buttons. Create one large enough to be useful on your page. Go to gesture actions and select swipe right - and as an action set a flag to ON. On the swipe left, set the flag to OFF.

Then associate that flag with the reveal menu of the subpage instance on a page. When the flag is on, the subpage will show (on that page only), when the flag is off it will hide. Other pages which use the same subpage are not affected.

Also see http://designer.docs.demopad.com/variables/flags/

anderdea
Posts: 78
Joined: Wed Mar 07, 2018 1:19 am

Re: Need help with flags

Post by anderdea » Mon Apr 02, 2018 2:40 pm

Thanks, I’ll give it a try.

anderdea
Posts: 78
Joined: Wed Mar 07, 2018 1:19 am

Re: Need help with flags

Post by anderdea » Mon Apr 02, 2018 9:22 pm

Frustrated!
OK, I set up a flags called show component subpage (ON) and Hide component subpage (OFF). Hidden OFF to be the default. I added my subpage entitled “links to components” to the left side of my Home Page, under horizontal view. I set up a transparent large button and in action editor for this button:

Swipe Left Action
Set a Flag
Hide component subpage (from flag list)
OFF - added it

Swipe Right Action
Set a Flag
Show Component subpage (from Flag List)
ON

I then selected the sub page line item of my home page, clicked on edit page load action in Page Settings
In Action Editor, I used
Set Flag
Show Component subpage
ON - added It

And did the same for OFF command

To link the “Links to Subpage” to the button.


Doesn’t work. I’m probably doing something dumb here but it’s got me real frustrated.

I just looked at the tutorial again. My issue is I’m not understanding what to apply the reveal action to. The button or the subpage. I’ve tried each and no luck.

I feel if I can master the flags process it will open a lot of options for me. So far, I’m no getting it. I looked at the tutorial a number of times but it doesn’t seem to apply to what I’m trying to do here.

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Need help with flags

Post by DemoPad » Tue Apr 03, 2018 9:08 am

You only need 1 flag to do this. Flags are project-wide, and can be set by any action, and can affect multiple things if used in several places. In your case though, you should just be using it on the reveal menu of the subpage.

Every page object, including a subpage instance has the reveal menu option. The default is that the object is always visible, but you can choose a flag instead, and then that object (subpage in your case) is only visible when the flag is ON, and invisible when the flag is OFF.

For now, suggest creating 2 buttons. In the release action of 1 button, set your flag ON. On the other, set your flag OFF.

If you have selected the flag on the reveal menu of the subpage correctly, you will see that when you set the flag ON, the subpage will show, and when you set the flag OFF the subpage will hide.

anderdea
Posts: 78
Joined: Wed Mar 07, 2018 1:19 am

Re: Need help with flags

Post by anderdea » Tue Apr 03, 2018 3:51 pm

OK, I have it partially working. I set up two buttons, 1 ON Flag to Show when released and 1 OFF flag to hide. Clicking on the subpage object link brings up the Reveal. I set the flag to ON and to reveal from left. When I initially look at it on my iPad the subpage isn’t showing. When I click on the “show subpage” button it shows from the left. OK. I am expecting it to disappear when I touch the “hide subpage” but it doesn’t. It remains visible. If I shut the Demopad App down on my iPad then relaunch it, the subpage remains visible on the Home Page and the buttons have no effect.

Also, if I set the reveal to flag “links to components OFF”, the buttons have no effect.
Last edited by anderdea on Tue Apr 03, 2018 3:55 pm, edited 1 time in total.

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Need help with flags

Post by DemoPad » Tue Apr 03, 2018 3:53 pm

You are using the same flag on both your buttons actions yes? Eg 'Show My Subpage' flag.

One button sets 'Show My Subpage' to ON
One button sets 'Show My Subpage' to OFF

The reveal menu for the subpage should have 'Show My Subpage' as the flag

anderdea
Posts: 78
Joined: Wed Mar 07, 2018 1:19 am

Re: Need help with flags

Post by anderdea » Tue Apr 03, 2018 4:06 pm

Well I finally got it through my thick skull. I had been using two separate flags instead of one and assigning the ON or OFF to it. It’s pretty simple now that I see it in action. As you said in your previous post, only need one flag. DUH!

Thanks for your patience.

User avatar
DemoPad
Site Admin
Posts: 769
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Need help with flags

Post by DemoPad » Tue Apr 03, 2018 11:09 pm

No problem at all. Once you get your head around flags, they are extremely powerful & useful. Any action can set them, and you an use them all over the place for revealing objects, conditional actions, highlighting etc.

Best to organise flags in folders (groups) so that you can also perform group operations, eg 'Exclusively On' which turns a flag on, and makes sure all other flags in the same group are turned off (useful for showing just 1 subpage at a time for example). You can also set an entire group of flags to all off with a single operation etc.

Post Reply