Passing arguments with event calls from Contraptions?
Hi! I was going through the "Breakout Three Ways" tutorial, and decided I wanted to make my own game-like object. I have an array of tiles (Contraptions from a Prototype Tile) and when the user clicks one, I want it to pass the tile's label (kept in a hidden field) to the top level Card script. That top-level script looks like this:
on moving which do alert["Yes, this is the card top level."] alert[which] end
So, the event should be "moving[]" which accepts an argument (`which`), right?
So, in my Prototype, I have this script attached to the invisible button that makes up the tile's face. The "which" field is hidden, keeping track of the label for the tile:
on click do card.parent.event.moving[which.text] end
This is based on the "Breakout" example, but none of the Card level event handlers take arguments, so I'm trying to supply the argument as I would with a regular function. I've also tried without the brackets and using literal strings or numbers instead of the text from the hidden "which" text field. And every time, all I get is zero, or null or empty (with event handler code above).
Can someone give me a hint on where I've gone wrong? This seems to be a reasonable way to call the event (other events seem to do it?). But if I can't get it to work, I'm going to have to do something stupid like set a flag on the Contraption and call the event and have the handler grovel through all the widgets to find out who's got the flag set. I guess if it works, it's not stupid, but it seems inefficient since I know what tile is raising the event?
Thanks!

