how to execute button on card from button on previous card
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
how to execute button on card from button on previous card
I have 7 cards I would like to execute a button on card1 have it run its code which would
include code to executing a button and card2 and card3
include code to executing a button and card2 and card3
Re: how to execute button on card from button on previous ca
Hi Mike,
this should do:
..
send "mouseup" to btn "your btn here" of cd "your target card here"
...
Best
Klaus
this should do:
..
send "mouseup" to btn "your btn here" of cd "your target card here"
...
Best
Klaus
Re: how to execute button on card from button on previous ca
more elegant still is to have the buttons simply call a handler that is stored further up the message path (eg stack script).
So your button could have the scriptand the stack script would include the handler
You can then use the same handler from anywhere in the stack, whichever card you are on when you want to call it. Sending messages to objects is great and powerful, but it is preferable to work with the natural message path when you can.
When you have understood a bit more, you should also investigate behavior scripts.
So your button could have the script
Code: Select all
on mouseUp
doMyEvents
end mouseUpCode: Select all
on doMyEvents
--do the things you want
answer "I'm working on the tasks"
end doMyEventsWhen you have understood a bit more, you should also investigate behavior scripts.
Re: how to execute button on card from button on previous ca
Thanks but the problem I'm running into is when the button is executed on the second card
its code uses fields in the second card and I'm getting no such object when it tries to use
these fields on the second card i guess because i'm still on the first card any answers?
its code uses fields in the second card and I'm getting no such object when it tries to use
these fields on the second card i guess because i'm still on the first card any answers?
Re: how to execute button on card from button on previous ca
same answer as for the other thread you made 
refer to the fields with the descriptor of the card they are on: field "fieldName" of card "cardName".
But as you get more experienced you will find less need to do this sort of thing.
refer to the fields with the descriptor of the card they are on: field "fieldName" of card "cardName".
But as you get more experienced you will find less need to do this sort of thing.
Re: how to execute button on card from button on previous ca
thanks it works I will just have to finish changing the code for two buttons by adding the card
name to every field. This is just my first app so should be good for now
name to every field. This is just my first app so should be good for now
Re: how to execute button on card from button on previous ca
Hi mikemc,
You can use
fld "myField" of this card
But also you can call the field from it's layer level
fld 1 of this cd
Simon
You can use
fld "myField" of this card
But also you can call the field from it's layer level
fld 1 of this cd
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: how to execute button on card from button on previous ca
This, me, the target, the owner will all be useful in days to come. But today, "this card" is not going to help, when referring to a field on a card other than this. So longhand addition of the card name to identify where the field is, is the order for now.
Success with this app/Scripting Conferences, object resolution, message path, behaviors, would be a natural progression.
Success with this app/Scripting Conferences, object resolution, message path, behaviors, would be a natural progression.
