Problem Description
C2 appears to detect that an object is part of a container and limits any events on that object to objects in that container, but it doesn't pick it up if the object the event on is part of a family.
I was writing a simple control that has a number, a + above it and a - below it. The idea is that the number is adjusted using the +/- buttons. I created a family Adjuster with an instance variable 'adjustAmount', which has two objects in it, AdjustUp and AdjustDown with the adjustAmount set to 1 and -1 respectively.
The text object with the number is a container containing an adjustUp and an adjustDown instance.
The original version (Layout 2) uses a single event to detect a touch on a member of the Adjuster family. The action is to add the adjustAmount in the Adjuster subclass to the boxValue in the Value object, and update the display.
However, the "Value" is not limited to the one in the Container with the Adjuster object but is the whole collection of such objects , so clicking on an Adjuster causes all values to change.
Layout 1 is identical save that there are two events, touch on AdjustUp and touch on AdjustDown , this works as intended.
Attach a Capx
.... how ? Can't see any upload button <img src="{SMILIES_PATH}/icon_e_sad.gif" alt=":(" title="Sad">
I've uploaded it to http://studio2.org.uk/ContainerBug.capx
Description of Capx
Layout 1 and 2 are identical apart from the event detection on the +/- text items. The idea is that the +/- should only adjust their own value.
Steps to Reproduce Bug
Compare Layout 1 (works) with Layout 2 (fails)
Observed Result
Layout 2, both numbers are changed by any adjuster button (a +/-)
Expected Result
The numbers and +/- should operate independently.
Affected Browsers
Should not be a browser specific issue, relates to compilation of events.
Operating System and Service Pack
Windows 8.1 current
Construct 2 Version ID
205.2