Hi all,
my project goes along smoothly, but I still have a problem with some mouseDown events.
When I enter a new card and click on the groups (that act as buttons) something strange happens. When I click a group that is unique to the card, all is fine. The mouseDown (in the cardscript) handles "the short name of the OWNER of the target" correctly, recognizes the group and the code is executed as it should.
When I click a group that is shared over several cards, all is fine as well.
However, when I first click a group unique to the card, and then a shared group, "the short name of the OWNER of the target" gives me a reference to my stack, instead of the group I clicked. When I click a second time, the group is referenced. So now my users have to click twice on the shared groups to be able to execute the attached code. I have no idea why, and have searched high and low to no avail.
Is there anyone that can come up with a solution?
thanks in advance,
Johan
owner of the target is stack instead of group | SOLVED
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
owner of the target is stack instead of group | SOLVED
Last edited by Johan_VH on Wed Jul 30, 2014 9:46 am, edited 3 times in total.
Re: owner of the target is stack instead of group
Hmmm.
Please post the stack
Craig Newman
Please post the stack
Craig Newman
Re: owner of the target is stack instead of group
Hi,
I had a day off yesterday, so with a bit of delay, here's my stack.
Mind you, it's my very first project in LiveCode, so expect a bit of completely non-logical stuff in my code.
When you open the stack, press the startbutton to, well, start it. That at the very least is logical!
Next select your language, press the 'next' button on the following screen and then you come to the genderscreen where it all goes haywire.
You should first select your gender, and after that press the 'next' button. But as you can see in the textfield, which shows the latest short name of the OWNER of the target, it first gives you the name of the stack. However, if you now press the 'back' button and you return to the genderscreen by pressing the 'next' button again, it doesn't make that detour. If you press the 'logout' button, which closes the stack you get the problem again after restarting the registration stack. I cannot give the user a standard gender preselection, since the entire exhibition (there are 20-plus interactive exhibits) is to test the differences between men and women. So we cannot have a possible wrong gender selection for the user because he or she didn't bother to change it were the pre-selection wrong for him or her. Hence the reason you only see the 'next'-button on this screen after selecting your gender.
By the way, if you see completely stupid things in my code that I really should handle differently in the future, you are free to let me know too. I won't be offended.
You can download it here: https://dl.dropboxusercontent.com/u/254 ... roblem.zip
The script that gives me issues is the cardscript of card "geslacht" of stack "registration". Thanks in advance!
I had a day off yesterday, so with a bit of delay, here's my stack.
Mind you, it's my very first project in LiveCode, so expect a bit of completely non-logical stuff in my code.

When you open the stack, press the startbutton to, well, start it. That at the very least is logical!
Next select your language, press the 'next' button on the following screen and then you come to the genderscreen where it all goes haywire.
You should first select your gender, and after that press the 'next' button. But as you can see in the textfield, which shows the latest short name of the OWNER of the target, it first gives you the name of the stack. However, if you now press the 'back' button and you return to the genderscreen by pressing the 'next' button again, it doesn't make that detour. If you press the 'logout' button, which closes the stack you get the problem again after restarting the registration stack. I cannot give the user a standard gender preselection, since the entire exhibition (there are 20-plus interactive exhibits) is to test the differences between men and women. So we cannot have a possible wrong gender selection for the user because he or she didn't bother to change it were the pre-selection wrong for him or her. Hence the reason you only see the 'next'-button on this screen after selecting your gender.
By the way, if you see completely stupid things in my code that I really should handle differently in the future, you are free to let me know too. I won't be offended.

You can download it here: https://dl.dropboxusercontent.com/u/254 ... roblem.zip
The script that gives me issues is the cardscript of card "geslacht" of stack "registration". Thanks in advance!
Re: owner of the target is stack instead of group-STACK POST
Hi Johan,
I changed in the 3 card scripts in stack "registration" the mouseDown handler to mouseUp. Now it seems to work. I just can not explain why. It probably has to do with the sharedGroups. The owner of a sharedGroup is the stack. I rarely use sharedGroups, so I am not shure why the behavior should be different mouseDown/mouseUp.
Anyways it is a good idea to catch a button action with mouseUp. MouseUp really makes shure the user released the mouse over the button. That is the way all buttons work.
I would be interested if making this change remedies what you are seeing.
Kind regards
Bernd
I changed in the 3 card scripts in stack "registration" the mouseDown handler to mouseUp. Now it seems to work. I just can not explain why. It probably has to do with the sharedGroups. The owner of a sharedGroup is the stack. I rarely use sharedGroups, so I am not shure why the behavior should be different mouseDown/mouseUp.
Anyways it is a good idea to catch a button action with mouseUp. MouseUp really makes shure the user released the mouse over the button. That is the way all buttons work.
I would be interested if making this change remedies what you are seeing.
Kind regards
Bernd
Re: owner of the target is stack instead of group-STACK POST
Grüss dich Bernd,
since the entire exhibition uses touchscreens, and having a button act on release on a touchscreen is counter-intuitive, I had to use the mouseDown event.
So I ungrouped all the buttons, removed the groups, saved and re-openend the project. For some reason, just ungrouping them didn't do the trick. The groups stayed visible in the application browser, and when I re-grouped them they still knew their old name and 'shared group' was selected but dimmed, so I couldn't deselect it. When the entire project was closed and re-opened that wasn't an issue anymore.
So I regrouped each button, gave it it's former name, and everything works fine on mouseDown events. I won't be using the shared group option anymore now!
Thanks for your help,
Johan
since the entire exhibition uses touchscreens, and having a button act on release on a touchscreen is counter-intuitive, I had to use the mouseDown event.
So I ungrouped all the buttons, removed the groups, saved and re-openend the project. For some reason, just ungrouping them didn't do the trick. The groups stayed visible in the application browser, and when I re-grouped them they still knew their old name and 'shared group' was selected but dimmed, so I couldn't deselect it. When the entire project was closed and re-opened that wasn't an issue anymore.
So I regrouped each button, gave it it's former name, and everything works fine on mouseDown events. I won't be using the shared group option anymore now!
Thanks for your help,
Johan