Button sticks when I press just inside and move finger out

My buttons are designed so that the action associated with it doesn't happen until I release. (I have two images; "button normal" and "button depressed". That way if you press it but slide your finger off, the button will change back to being up, without the action happening. It works fine except when I press just on the edge and barely slide off, the button gets stuck in the depressed position. I turn a boolean trigger on when pressed, to avoid going into infinite loops. But I don't think I'm using the "touch pressed/released" stuff right....or MAYBE it is just an internal timer issue? If it can't be resolved, I may change it so the action happens when I press down, because I don't want it to look sloppy.
Thanks!
dF
Thanks!
dF
Comments
I just think I tried to embed something properly and didn't quite understand how each one worked (since my code failed).
you could create a separate smaller square transparent image to top the button and have it respond to the touch/mouse rules.
MH
See how in GameSalad, the green preview button darkens when you press the mouse button down, but the preview doesn't start unless you release? AND, if you press the mouse button down, but -slide- the mouse off of the button, the button goes back to normal and the preview doesn't activate?
I want all my buttons to do that. Yet no matter what I try I either get the button to activate when I slide off, or I go into endless loops, etc.
in GS you have to play around with the options for mouse button and mouse position
in GS: File:new project … create 4 actors … on each Actor create a Rule each having one of the 4 mouse conditions
put a simple action/event in those rules: EX: changeAttribute [exp] self.color.Red To: 0
drag all four actors to the scene and preview what happens when the mouse is active
in other words learn to play in a sandbox … rather than attempt new things in your working Project
do new actions events that you aren't sure will work, or to figure out the best way to make things work, in a sandbox project.
less frustrating, more effective learning, and wont corrupt your good project.
MH
How to make a button depress and only do an action when released within the button (a mute toggle, in this example):
Rule: When touched is released,
**Rule: When attribute game.sound = 1
-----------Set Image to Soundoff
-----------Change Attribute game.sound to 0
**Otherwise:
-----------Set Image to Soundon
-----------Change Attribute game.sound to 1
----------------------------------------------
Rule: When touch is pressed AND
Mouse position is inside
---------Set Image to Soundpressed
Otherwise:
**Rule: When game.sound = 0
------------Set Image to Soundoff
**Otherwise:
------------Set Image to Soundon