Buttons to disappear/appear

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Nicvan
    Forum Member
    • May 2003
    • 2

    Buttons to disappear/appear

    I am a newbie with AMS 4 and I am trying to create the following.

    Page 1 has a button (CONDITIONS) is visible when the page first opens. The user clicks on this and it takes them to Page 2 which contains "Conditions of Use".

    Page 2 has a button (ACCEPT) they can click to accept the conditions of use. I would like to record this acceptance in the registry with a "CURRENT_USER" key. By clicking on ACCEPT, they are returned to Page 1, where CONDITIONS is now hidden (hidden when they clicked ACCEPT). (Page 2 also has an exit button which closes the application without recording anything)

    By clicking on CONDITIONS, they have also made visible on Page 1 a second button (RUN).

    When Autorun next opens, I would like it to check the registry, and if ACCEPT was clicked before, only RUN is to be visible on Page 1.

    If anyone can help, it would be greatly appreciated.
  • Derek
    Indigo Rose Customer
    • May 2001
    • 1254

    #2
    Re: Buttons to disappear/appear

    Hi Nicvan

    Here's what yu do:

    [/quote]<font color=red>Page 1
    </font color=red>
    Have yur Text Objects - Conditions and Run

    In the page OnInitialize event, set an action to check the registry:
    <font color=green>%RegData% = Registry.GetValueData ("HKEY_CURRENT_USER\AppEvents", "AMS4")</font color=green> - set the error on here to 'none'

    In the page OnShow event set something like the following:
    <font color=blue>IF (%RegData% = accept)</font color=blue>
    <font color=green>Page.HideObject ("Text1")
    Page.ShowObject ("Text2")</font color=green>
    <font color=blue>ELSE</font color=blue>
    <font color=green>Page.HideObject ("Text2")
    Page.ShowObject ("Text1")</font color=green>
    <font color=blue>END IF</font color=blue>

    <font color=red>
    Page 2
    </font color=red>
    Set out yur conditions and Text Objects Accept and Exit

    In the OnClick event for Accept, set the following actions:
    <font color=green>Registry.SetValue ("HKEY_CURRENT_USER\AppEvents", "AMS4", "accept")
    Page.Jump ("Page 1")</font color=green>

    In the OnClick event for Exit, set the following action:
    <font color=green>Application.Exit</font color=green>

    [/quote]Of course, you should adjust the reg Key to something more suitable [img]/ubbthreads/images/icons/smile.gif[/img]
    -
    = Derek
    ["All glory comes from daring to begin" - fortune cookie]

    Comment

    • Bruce
      Indigo Rose Customer
      • Jun 2001
      • 2134

      #3
      Re: Buttons to disappear/appear

      AHHH You got it before me! LOL Well, that's how ya learn!

      Comment

      • Corey
        Indigo Rose Staff Alumni
        • Aug 2002
        • 9745

        #4
        Re: Buttons to disappear/appear

        Superb answer DJ...

        Corey Milner
        Creative Director, Indigo Rose Software

        Comment

        • Bruce
          Indigo Rose Customer
          • Jun 2001
          • 2134

          #5
          Re: Buttons to disappear/appear

          Here's a working ver. of Derek's great work.

          Comment

          • Derek
            Indigo Rose Customer
            • May 2001
            • 1254

            #6
            Re: Buttons to disappear/appear

            As an after thought, yu may want to consider using something like %LANUser% to get the currently logged in user and have reg entries for each user. Check the info on this in the helpfile tho. [img]/ubbthreads/images/icons/smile.gif[/img]
            -
            = Derek
            ["All glory comes from daring to begin" - fortune cookie]

            Comment

            Working...
            X