entire screen responds to mouseDown | SOLVED |
Posted: Tue Jul 08, 2014 4:43 pm
Just when I thaugt everything was going smoothly... I clicked at random on the screen, and it responded to the mouseDown...
I have 3 buttons that behave like a background on all my cards. These buttons are groups of a button, a text layer and a graphic layer.
I have this code placed on each button, because I cannot seem to get it to work if I put it on a card script.
It works, each button does as it should, so it gets the name of the group they belong to. I cannot get the name of the group if I put it in a card script for some reason. That doesn't really bother me right now, it's only 3 buttons, but why oh why does the rest of the screen execute the mouseDown script?? It takes the script of the group in the uppermost layer by the way.
Ideally, I would like to have the entire mouse Event handling on a stack script, that would seem the most logically to me, but as stated above, I can't get the name of the group, just of the separate elements of which the group consists... (I tried 'target')
Anyone...?
Johan
I have 3 buttons that behave like a background on all my cards. These buttons are groups of a button, a text layer and a graphic layer.
I have this code placed on each button, because I cannot seem to get it to work if I put it on a card script.
Code: Select all
on mouseDown
local thisGroup
put the short name of group me into thisGroup
put (thisGroup)
switch (thisGroup)
case "next_btn"
set the icon of button ("navigation_btn") of group ("next_btn") to "button_zwart.png"
go to the next card of stack "registration"
break
case "back_btn"
set the icon of button ("navigation_btn") of group ("back_btn") to "button_zwart.png"
break
case "logout_btn"
set the icon of button ("navigation_btn") of group ("logout_btn") to "button_zwart.png"
break
end switch
end mouseDown
on mouseLeave
call "navWhite" of card "taal" of stack "registration"
end mouseLeave
Ideally, I would like to have the entire mouse Event handling on a stack script, that would seem the most logically to me, but as stated above, I can't get the name of the group, just of the separate elements of which the group consists... (I tried 'target')
Anyone...?
Johan