Widget 2.0 newButton onEvent is not calling the "ended" phase - Build 2013.1043

On Build 2013.1043, the following code will print out the “began” and “moved” phases but not the “ended” phase:

local button = widget.newButton{
defaultFile=“default.png”,
overFile=“over.png”,
width=100, height=100,
onEvent = function(event) print("Phase: " … event.phase); end
};
button.x = display.contentWidth * 0.5;
button.y = display.contentHeight * 0.5; [import]uid: 145848 topic_id: 36942 reply_id: 336942[/import]

Hey Chronon.

That was actually a bug that it previously reported an “ended” event when you released the touch outside of the buttons bounds.

Perhaps firing a “cancelled” event when that scenario occurs would be better than doing nothing? What do you think? [import]uid: 84637 topic_id: 36942 reply_id: 145175[/import]

To clarify, the “ended” event is not called when the mouse button is released outside the button’s boundaries.

My code has images that shrink when the button is pressed and go back to normal size when the button is released. I need some kind of event when the button is released outside the button’s boundaries to call code that brings the images back to normal size. [import]uid: 145848 topic_id: 36942 reply_id: 145174[/import]

That would be perfect. [import]uid: 145848 topic_id: 36942 reply_id: 145176[/import]

Hey Chronon.

That was actually a bug that it previously reported an “ended” event when you released the touch outside of the buttons bounds.

Perhaps firing a “cancelled” event when that scenario occurs would be better than doing nothing? What do you think? [import]uid: 84637 topic_id: 36942 reply_id: 145175[/import]

To clarify, the “ended” event is not called when the mouse button is released outside the button’s boundaries.

My code has images that shrink when the button is pressed and go back to normal size when the button is released. I need some kind of event when the button is released outside the button’s boundaries to call code that brings the images back to normal size. [import]uid: 145848 topic_id: 36942 reply_id: 145174[/import]

That would be perfect. [import]uid: 145848 topic_id: 36942 reply_id: 145176[/import]

Hey Chronon.

That was actually a bug that it previously reported an “ended” event when you released the touch outside of the buttons bounds.

Perhaps firing a “cancelled” event when that scenario occurs would be better than doing nothing? What do you think? [import]uid: 84637 topic_id: 36942 reply_id: 145175[/import]

To clarify, the “ended” event is not called when the mouse button is released outside the button’s boundaries.

My code has images that shrink when the button is pressed and go back to normal size when the button is released. I need some kind of event when the button is released outside the button’s boundaries to call code that brings the images back to normal size. [import]uid: 145848 topic_id: 36942 reply_id: 145174[/import]

That would be perfect. [import]uid: 145848 topic_id: 36942 reply_id: 145176[/import]

Is there an ETA for the “cancelled” event? My code is broken until an event is added.

 

This week.

 

Great, thank you!

Hey Chronon.

That was actually a bug that it previously reported an “ended” event when you released the touch outside of the buttons bounds.

Perhaps firing a “cancelled” event when that scenario occurs would be better than doing nothing? What do you think? [import]uid: 84637 topic_id: 36942 reply_id: 145175[/import]

To clarify, the “ended” event is not called when the mouse button is released outside the button’s boundaries.

My code has images that shrink when the button is pressed and go back to normal size when the button is released. I need some kind of event when the button is released outside the button’s boundaries to call code that brings the images back to normal size. [import]uid: 145848 topic_id: 36942 reply_id: 145174[/import]

That would be perfect. [import]uid: 145848 topic_id: 36942 reply_id: 145176[/import]

Hello, it’s been a week. Please don’t let this feature slip through the cracks!

It’s fixed internally. Just waiting to go into a daily build :wink:

Is there an ETA for the “cancelled” event? My code is broken until an event is added.

 

This week.