Page 1 of 1

pushbutton routine

PostPosted: Thu Jul 03, 2014 5:45 am
by reneuend
Fixed (July 6th, 2014):

Here is a simple routine you can use for any hot spot you want to set up as a pushbutton that when clicked will looked depressed for a couple seconds. I will add more features to it when l can actually get to a computer instead of typing from a phone.
I haven't tested this but I know it's close. I will fix if it isn't correct. I just don't have access to a computer until Sunday.

1. Create an image of a button
2. Create a copy of the button from step 1 and make it looked pressed in. The filename should be the same as the other image but with "_2" at the end of the name.
3. Create 1 hotspot and display the button.
4. Create a variant variable called, "imgfile"
4. Call the subroutine below in this hotspot.

In your hotspot call the subroutine shown below.
Example:

Put the following in the Advanced tab:

Code: Select all
imgfile = "btn.jpg"
pushButton()


Now put the following subroutine in the advanced procedures tab.

Code: Select all
Sub pushButton ()
    Dim imgfile2
    'Example: If imgfile="btn.jpg" then imgfile2="btn_2.jpg"
    Imgfile2 = left (imgfile, len (imgfile)-6) & "_2" & right (imgfile, 4)
    Action.LoadAPicture hotspot (Action.GetHotspotNumber), imgfile2
    Action.CreateTimedEvent 2, "Action.LoadAPicture hotspot (Action.GetHotspotNumber), imgfile", false
End Sub


I'll add a video How-To later and add a link at the end of this post.

Re: pushbutton routine

PostPosted: Thu Jul 03, 2014 8:48 am
by Vengeance66
Cool! :)

Re: pushbutton routine

PostPosted: Thu Jul 03, 2014 12:09 pm
by skype6
Great, now just to figure out how this works!

Re: pushbutton routine

PostPosted: Thu Jul 03, 2014 6:03 pm
by reneuend
I'll give a better explanation on Sunday.