Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2002
    Posts
    57

    Maintaining checkbox states between pages

    I have a checkbox on each page that allows the end user to turn off background music if checked. I am trying to maintain the checkbox state between pages, and am having difficulty maintaining the states when a new page is jumped to. I don't know where to place the code; on preload, on show, on click? It seems I have tried everything. Please help. Here is the 7th iteration of code, placed in the on click and on show events for each page:

    isChecked2 = false;
    isChecked2 = Button.GetState("checkbox");
    if (isChecked2 ~= 1) then
    Button.SetState("checkbox", BTN_UP);
    Button.SetState("checkbox2", BTN_UP);
    Audio.Play(CHANNEL_BACKGROUND);
    isChecked2 = false;
    else
    Button.SetState("checkbox", BTN_DOWN);
    Button.SetState("checkbox2", BTN_DOWN);
    Audio.Stop(CHANNEL_BACKGROUND);
    isChecked2 = true;
    end

    TIA,

    Kurt

  2. #2
    Join Date
    Dec 2003
    Location
    The Netherlands
    Posts
    475
    Page On Show
    Code:
    if (button == 0) then
    Button.SetState("Button1", BTN_UP);
    elseif (button == 1) then
    Button.SetState("Button1", BTN_DOWN);
    end
    Button On Click
    Code:
    if (Button.GetState("Button1") == 0) then
    button = 0
    elseif (Button.GetState("Button1") == 1) then
    button = 1
    end
    Place the code in every page (on show) and button (on click) and add the rest of the code for the music to be played or stopped

    Note: I'm describing here only how to maintain the button state. This is what i understand you're having problems with...

    sside
    Last edited by sside; 12-03-2004 at 02:47 PM.

  3. #3
    Josué Alba Guest

    A working Example

    Hey I made an example for you
    Attached Files

  4. #4
    Join Date
    Jun 2002
    Posts
    57
    Good stuff, Jose'! Thanks!

  5. #5
    Join Date
    Nov 2001
    Posts
    72

    Thumbs up Sweet!

    I was working on something similiar today for a project. Thanks Jose!

Similar Threads

  1. Copying an Object to Multiple Pages - HOW?
    By dsuden in forum AutoPlay Media Studio 5.0
    Replies: 2
    Last Post: 06-05-2004, 04:01 PM
  2. Setting variable Windows Title for all pages
    By cchian in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 05-13-2004, 10:19 AM
  3. Fade transition between pages...
    By zymad in forum AutoPlay Media Studio 5.0
    Replies: 9
    Last Post: 03-11-2004, 11:39 AM
  4. limit to number of pages?
    By yosik in forum AutoPlay Media Studio 4.0
    Replies: 0
    Last Post: 02-17-2003, 11:19 AM
  5. mp3 and switching pages
    By grommit in forum AutoPlay Media Studio 4.0
    Replies: 8
    Last Post: 12-20-2002, 08:50 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts