Re: 'send' and behaviors

2012-06-04 Thread Graham Samuel
Thanks Dar - I guess your 'A' is the way to go, and I'm doing it (more or less). I don't see how to do 'B' in a way that very simply returns control to the original caller (CardX) without extra code in the handler asking "do I have to go back to CardX or not?", which I think would be even more m

Re: 'send' and behaviors

2012-06-04 Thread Ken Ray
> I think from what I've been told (but I really am still studying it) that > this is just plain impossible in LC; so I need to rewrite the handlers in the > behaviors to be more context-aware, possibly using the techniques suggested. > It's not really that hard, but it doesn't have the generali

Re: 'send' and behaviors

2012-06-03 Thread Dar Scott
I hope I'm not adding more confusion. I see a couple directions for a solution. There are probably other ways. A. In your behavior scripts sprinkle 'of me' throughout. B. Lock screen and move to the card at the start of the handler and then move back and unlock at the end. Dar If the lat

Re: 'send' and behaviors

2012-06-03 Thread Graham Samuel
Thanks again to Mark, Dar and Ken to replying. What a lot of good advice! Let's hope I'm clever enough to follow it. While I'm studying your comments, I thought perhaps a little more explanation is in order, because I still don't think I've explained myself properly. If you're getting bored, sto

Re: 'send' and behaviors

2012-06-03 Thread Peter Haworth
I think a point that's being missed here is Graham's quote from the dictionary in his original post: "Therefore references within the message that refer to "this card" or "this stack" will be referring to the card or stack where the target handler is located." Clearly, that's not the case in this

Re: 'send' and behaviors

2012-06-03 Thread Dar Scott
On Jun 3, 2012, at 2:11 AM, Graham Samuel wrote: > and a lot more complex stuff involving lists of object name I don't know if this applies, but it might. The long id of an object can be used where an object reference is expected. It can be a way to reference the object in any context. You ca

Re: 'send' and behaviors

2012-06-03 Thread Ken Ray
> send "doSomething" to grp "someGroupedControls" of cd "B" > > but I don't think this changes anything. If I'm understanding you properly, you're on cd "A" of a stack and are trying to send messages to an object in cd "B" of the same stack? If so, then as others have pointed out, "this card" i

Re: 'send' and behaviors

2012-06-03 Thread Mark Schonewille
Hi Graham, If you are using the same script for multiple cards, then you could use a property: set the someProp of cd x to y setProp someProp theData put the long id of the target into myTarget put line 1 of theData into field x1 of myTarget put line 2 of theData into field x2 of myTarget

Re: 'send' and behaviors

2012-06-03 Thread Graham Samuel
Thanks to Mark and Dar for your replies. I'm afraid I didn't explain myself clearly, and I chose a stupid example of what I thought was the 'wrong' card reference, which obscured my real problem, which is this - the handler which I've called "doSomething" was written to take advantage of the con

Re: 'send' and behaviors

2012-06-02 Thread Dar Scott
There are two problems with that description. One is what Mark mentioned. The default stack will change to the stack of the target object and the default card will be the current card of that the new default stack. However, there is something else. The word "message" should be replaced with

Re: 'send' and behaviors

2012-06-02 Thread Dar Scott
This can be confusing. I think it is the word "this" that causes confusion. The behavior is strange in that "this stack", meaning the current stack, will change even when it is not foremost and even if it is invisible or deleted. At times some folks naturally expect that and at times some oth

Re: 'send' and behaviors

2012-06-02 Thread Mark Schonewille
Hi Graham, A card is not a stack (obviously). The stack containing the card temporarily becomes the default stack, but "this stack" still refers to the currently visible card of the stack rather than the card containing the script. If you really want to refer to the card containing the script (