Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    5

    Grin help with multiple buttons

    hi all it has been a while since i used APMS
    so if anyone can help me with this it would be much appreciated

    i have 7 buttons and 7 images on a page.
    i would like to be able to click button 7 and check if button 1 is enabled if it is
    then set image 1 enabled and visible,if it not then check if button 2 is enabled
    if it is then set image 2 enabled and visible,if its not then check if button 3 is enabled if it is then set image 3 enabled and visible,if not then check 4,if not then check 5 and so on

    if anyone has an example how to do this or any help it is much appreciated

    Thanks sawyer

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    ok, heres how i would do it,

    first make 2 tables containing the button and image names

    Code:
    tblButtons={}
    tblButtons[1]="Button1"
    tblButtons[2]="Button2"
    tblButtons[3]="Button3"
    tblButtons[4]="Button4"
    tblButtons[5]="Button5"
    tblButtons[6]="Button6"
    tblButtons[7]="Button7"
    
    tblImages={}
    tblImages[1]="Image1"
    tblImages[2]="Image2"
    tblImages[3]="Image3"
    tblImages[4]="Image4"
    tblImages[5]="Image5"
    tblImages[6]="Image6"
    tblImages[7]="Image7"
    then use a for loop to check the buttons
    Code:
    for index, Button in tblButtons do 
    	if Button.IsEnabled(Button) then
    		tbImageProps={}
    		tbImageProps.Enabled=true
    		tbImageProps.Visible=true
    		Image.SetProperties(tblImages[index], tbImageProps);
    		break
    	end
    end
    the above code is not tested, its off the top of my head but it should work
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Jul 2004
    Posts
    5

    Smile thanks for your quick reply rizlauk

    thanks for your help but i i havn't done any work with tables or scripts just basic actions with buttons objects etc (click and do) dont suppose you have an example apz lying around ? It would be very appreciated,i will see if i can get your code to work for me either way

    thanks a lot for your help sawyer

  4. #4
    Join Date
    Jun 2006
    Location
    UK SouthWest
    Posts
    420
    Another way you could do it is name the buttons but1,but2 etc and name the images img1,img2,img3 etc.
    Then in your Global functions have;-
    Code:
    function CheckButtons()
    local inc =0;
    for inc=1,7 do
        if Button.IsEnabled("but"..inc) == true then
           Image.SetVisible("img"..inc, true)
           return
           end
       end
    end
    Then just link the function to button7.
    Last edited by clueless; 01-21-2008 at 09:38 PM.

Similar Threads

  1. i love buttons !
    By noonmoon in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 01-15-2010, 05:05 AM
  2. Import buttons created by Fireworks 8?
    By edsager in forum AutoPlay Media Studio 6.0
    Replies: 1
    Last Post: 12-22-2006, 02:29 AM
  3. Multiple Videos on 1 Page with Buttons
    By tranquilraven in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 05-02-2005, 12:38 PM
  4. Default text in edit field - Multiple edit screen
    By Romahe in forum Setup Factory 6.0
    Replies: 1
    Last Post: 12-18-2001, 01:01 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