Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014

    Which button was that again?

    Ok here's what I have...


    Global-

    function WhatButton2(ButtonName)
    if ButtonName == "tan_cert_Button" then
    sbutton = "tan"

    elseif ButtonName2 == "salon_sales_Button" then
    sbutton = "sales"

    elseif ButtonName2 == "skin_care_Button" then
    sbutton = "skin"

    elseif ButtonName2 == "spray_on_Button" then
    sbutton = "spray"

    elseif ButtonName2 == "first_impressions_Button" then
    sbutton = "first"

    end
    end

    Now, on the next page I have five buttons. On each button I have:

    WhatButton2(this);
    Page.Jump("paypal");
    This then jumps to another page that displays an .html, at the botton of of this page there is a button that has this code:

    if sbutton == "tan" then
    Page.Jump("tan reg");

    elseif sbutton == "sales" then
    Page.Jump("sales reg");

    elseif sbutton == "skin" then
    Page.Jump("skin reg");

    elseif sbutton == "spray" then
    Page.Jump("spray reg");

    elseif sbutton == "first" then
    Page.Jump("first reg");

    end
    The first one works (if sbutton == "tan" then
    Page.Jump("tan reg");
    ) but none of the others will, any ideas? BTW I do not have Quick Actions on any of the buttons. (thanks Tigg)

  2. #2
    Join Date
    Dec 2003
    Posts
    891
    Have you tried turning on your debug display and see what is not firing correctly?
    It's in the edit-preferences-build section.

  3. #3
    Join Date
    Oct 2004
    Location
    East, South & West Asia
    Posts
    1,020
    Bruce,

    Did u noticed that in ur Global, u did not end each variable assignment with a ";"?
    Newbie Examples
    ------> AMS 7.5 : amstudio.azman.info
    ----> AMS 6 & 5: www.azman.info/ams/
    ----> FB: facebook.com/GuideToWealth

    ----> Content Development Blog: www.AZMAN.asia

  4. #4
    Join Date
    Nov 2005
    Location
    Banned by moderator.
    Posts
    264
    Or use Debug.ShowWindow(true) & set false to close it. I can't see any error in your code...
    EDIT: Ahh...here's your problem. You are calling another string. Remove the digit '2' and it works fine:

    Code:
    function WhatButton2(ButtonName)
    if ButtonName == "tan_cert_Button" then
    sbutton = "tan"
    
    elseif ButtonName == "salon_sales_Button" then
    sbutton = "sales"
    
    elseif ButtonName == "skin_care_Button" then
    sbutton = "skin"
    
    elseif ButtonName == "spray_on_Button" then
    sbutton = "spray"
    
    elseif ButtonName == "first_impressions_Button" then
    sbutton = "first"
    
    end
    end
    Quote Originally Posted by azmanar
    Did u noticed that in ur Global, u did not end each variable assignment with a ";"?
    I don't think it's needed. It works for me withut the ";"
    Last edited by playmenow; 04-10-2006 at 12:13 PM.

  5. #5
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Quote Originally Posted by playmenow
    Or use Debug.ShowWindow(true) & set false to close it. I can't see any error in your code...
    EDIT: Ahh...here's your problem. You are calling another string. Remove the digit '2' and it works fine:

    Code:
    function WhatButton2(ButtonName)
    if ButtonName == "tan_cert_Button" then
    sbutton = "tan"
    
    elseif ButtonName == "salon_sales_Button" then
    sbutton = "sales"
    
    elseif ButtonName == "skin_care_Button" then
    sbutton = "skin"
    
    elseif ButtonName == "spray_on_Button" then
    sbutton = "spray"
    
    elseif ButtonName == "first_impressions_Button" then
    sbutton = "first"
    
    end
    end


    I don't think it's needed. It works for me withut the ";"

    Well...This is also in the global, first.

    function WhatButton(ButtonName)
    if ButtonName == "tan_cert_Button" then

    sURL = "AutoPlay\\Docs\\pay_basic.html"

    elseif ButtonName == "salon_sales_Button" then

    sURL = "AutoPlay\\Docs\\pay_sales.html"

    elseif ButtonName == "skin_care_Button" then

    sURL = "AutoPlay\\Docs\\pay_skin.html"

    elseif ButtonName == "spray_on_Button" then

    sURL = "AutoPlay\\Docs\\pay_spray.html"

    elseif ButtonName == "first_impressions_Button" then

    sURL = "AutoPlay\\Docs\\pay_first.html"

    end
    end

  6. #6
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    This seems to be a dead thread...
    Maybe I have two functions that are causing each other some grief... Lets try this again with all the info.



    Global:

    function WhatButton(ButtonName)
    if ButtonName == "tan_cert_Button" then

    sURL = "AutoPlay\\Docs\\pay_basic.html"

    elseif ButtonName == "salon_sales_Button" then

    sURL = "AutoPlay\\Docs\\pay_sales.html"

    elseif ButtonName == "skin_care_Button" then

    sURL = "AutoPlay\\Docs\\pay_skin.html"

    elseif ButtonName == "spray_on_Button" then

    sURL = "AutoPlay\\Docs\\pay_spray.html"

    elseif ButtonName == "first_impressions_Button" then

    sURL = "AutoPlay\\Docs\\pay_first.html"

    end
    end


    --================================================== =======


    function WhatButton2(ButtonName)
    if ButtonName == "tan_cert_Button" then
    sbutton = "tan"

    elseif ButtonName2 == "salon_sales_Button" then
    sbutton = "sales"

    elseif ButtonName2 == "skin_care_Button" then
    sbutton = "skin"

    elseif ButtonName2 == "spray_on_Button" then
    sbutton = "spray"

    elseif ButtonName2 == "first_impressions_Button" then
    sbutton = "first"

    end
    end


    What each button has in it:

    WhatButton(this);
    WhatButton2(this);
    Page.Jump("paypal");


    On "paypal" page:

    if not sURL then
    sURL = "about:blank"
    end
    Web.LoadURL("Web1", sURL)


    What's in the continue button on the same page:

    if sbutton == "tan" then
    Page.Jump("tan reg");
    elseif sbutton == "sales" then
    Page.Jump("sales reg");
    elseif sbutton == "skin" then
    Page.Jump("skin reg");
    elseif sbutton == "spray" then
    Page.Jump("spray reg");
    elseif sbutton == "first" then
    Page.Jump("first reg");
    end


    This is sucking wind

  7. #7
    Join Date
    Nov 2005
    Location
    Banned by moderator.
    Posts
    264
    Yes, and all I see wrong is here:

    function WhatButton2(ButtonName)
    if ButtonName == "tan_cert_Button" then
    sbutton = "tan"

    elseif ButtonName2 == "salon_sales_Button" then
    sbutton = "sales"

    elseif ButtonName2 == "skin_care_Button" then
    sbutton = "skin"

    elseif ButtonName2 == "spray_on_Button" then
    sbutton = "spray"

    elseif ButtonName2 == "first_impressions_Button" then
    sbutton = "first"

    end
    end

    You could add the digit '2' at the end os the string at it should work fine.

  8. #8
    Join Date
    Jun 2001
    Location
    California
    Posts
    2,014
    Got it! Thanks to everyone I'll show you what I did later, I gotta get some sleep!

Similar Threads

  1. Example: Creating an on/off button to toggle background audio
    By Jonas DK in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 07-10-2004, 02:54 PM
  2. Dynamic Return Button
    By Octaine in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 06-29-2004, 01:43 PM
  3. Button Hiding Blues
    By Tezcatlipoca in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 04-11-2003, 04:57 PM
  4. INFO: The Explore Button on the Distribution Folder Dialog
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-11-2002, 12:06 PM

Posting Permissions

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