Sending mouseup to checkboxes on different card

classic Classic list List threaded Threaded
25 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Sending mouseup to checkboxes on different card

charles61
This post was updated on .
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

dunbarxx
Hi.

It works. It is possible you left that line break in the second "if"
statement?

Craig Newman
In a message dated 10/20/10 10:04:01 AM, [hidden email] writes:


> on mouseUp
> repeat with y = 1 to the number of cards
>       repeat with b= 1 to the number of buttons of card y
>          if the style of button b of card y = "checkbox" then
>             if the hilite of button b of card y = "true" then send mouseUp
> to button b of card y
>          end if
>       end repeat
> end repeat
> end mouseUp
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
Hi Craig!

I checked for line breaks but there is none. I think the one in my posting was due to cutting and pasting the code to Nabble.

My sample stack of two cards has four checkboxes on one card and four on the second. Each checkbox has code to show a field that when it is checked. To see if the checkboxes are receiving the mouseUp, I set all of the fields associated with the checkboxes to invisible. The checkboxes that are checked on the first card show the fields but the checkboxes on the second card do not and generates an error message in the IDE when I pressed the mouseUp button on the first card. If I click on the checkbox to uncheck, the error message appears for the next checkbox that is checked. If you have any other ideas, please feel free to suggest them!

Charles Szasz
[hidden email]




On Oct 20, 2010, at 10:12 AM, dunbarx [via Runtime Revolution] wrote:

Hi.

It works. It is possible you left that line break in the second "if"
statement?

Craig Newman
In a message dated 10/20/10 10:04:01 AM, <a href="x-msg://26/user/SendEmail.jtp?type=node&amp;node=3003945&amp;i=0" target="_top" rel="nofollow">[hidden email] writes:


> on mouseUp
> repeat with y = 1 to the number of cards
>       repeat with b= 1 to the number of buttons of card y
>          if the style of button b of card y = "checkbox" then
>             if the hilite of button b of card y = "true" then send mouseUp
> to button b of card y
>          end if
>       end repeat
> end repeat
> end mouseUp
>
_______________________________________________
use-revolution mailing list
<a href="x-msg://26/user/SendEmail.jtp?type=node&amp;node=3003945&amp;i=1" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3003945.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

Robert Brenstein
On 20.10.10 at 07:49 -0700 charles61 apparently wrote:

>Hi Craig!
>
>I checked for line breaks but there is none. I think the one in my
>posting was due to cutting and pasting the code to Nabble.
>
>My sample stack of two cards has four checkboxes on one card and
>four on the second. Each checkbox has code to show a field that when
>it is checked. To see if the checkboxes are receiving the mouseUp, I
>set all of the fields associated with the checkboxes to invisible.
>The checkboxes that are checked on the first card show the fields
>but the checkboxes on the second card do not and generates an error
>message in the IDE when I pressed the mouseUp button on the first
>card. If I click on the checkbox to uncheck, the error message
>appears for the next checkbox that is checked. If you have any other
>ideas, please feel free to suggest them!
>
>Charles Szasz
>[hidden email]
>

Craig meant me thinks that your inner if should be

if the hilite of button b of card y = "true" then
   send mouseUp to button b of card y
end if

instead of

if the hilite of button b of card y = "true" then send mouseUp to
button b of card y

to avoid compilation ambiguity.

Anyway, your script may fail if your mouseup function does sth that
refers to the buttons on the other card, which are not present on the
current card and it does not make full reference to them but only
uses short names.

Robert
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
Robert,

I am sorry for the wrong name! I was looking at an e-mail above yours when I sent you a reply. I will try your suggestion and read your comments. Thanks!

Charles Szasz
[hidden email]




On Oct 20, 2010, at 11:10 AM, Robert Brenstein [via Runtime Revolution] wrote:

On 20.10.10 at 07:49 -0700 charles61 apparently wrote:

>Hi Craig!
>
>I checked for line breaks but there is none. I think the one in my
>posting was due to cutting and pasting the code to Nabble.
>
>My sample stack of two cards has four checkboxes on one card and
>four on the second. Each checkbox has code to show a field that when
>it is checked. To see if the checkboxes are receiving the mouseUp, I
>set all of the fields associated with the checkboxes to invisible.
>The checkboxes that are checked on the first card show the fields
>but the checkboxes on the second card do not and generates an error
>message in the IDE when I pressed the mouseUp button on the first
>card. If I click on the checkbox to uncheck, the error message
>appears for the next checkbox that is checked. If you have any other
>ideas, please feel free to suggest them!
>
>Charles Szasz
><a href="x-msg://29/user/SendEmail.jtp?type=node&amp;node=3004073&amp;i=0" target="_top" rel="nofollow">[hidden email]
>
Craig meant me thinks that your inner if should be

if the hilite of button b of card y = "true" then
   send mouseUp to button b of card y
end if

instead of

if the hilite of button b of card y = "true" then send mouseUp to
button b of card y

to avoid compilation ambiguity.

Anyway, your script may fail if your mouseup function does sth that
refers to the buttons on the other card, which are not present on the
current card and it does not make full reference to them but only
uses short names.

Robert
_______________________________________________
use-revolution mailing list
<a href="x-msg://29/user/SendEmail.jtp?type=node&amp;node=3004073&amp;i=1" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004073.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
In reply to this post by Robert Brenstein
Robert,

I tried your suggestion. But I get the same results: the checkboxes received the message on the first card but the checkboxes on the second card did not receive the mouseUp message. 

Charles Szasz
[hidden email]




On Oct 20, 2010, at 11:10 AM, Robert Brenstein [via Runtime Revolution] wrote:

On 20.10.10 at 07:49 -0700 charles61 apparently wrote:

>Hi Craig!
>
>I checked for line breaks but there is none. I think the one in my
>posting was due to cutting and pasting the code to Nabble.
>
>My sample stack of two cards has four checkboxes on one card and
>four on the second. Each checkbox has code to show a field that when
>it is checked. To see if the checkboxes are receiving the mouseUp, I
>set all of the fields associated with the checkboxes to invisible.
>The checkboxes that are checked on the first card show the fields
>but the checkboxes on the second card do not and generates an error
>message in the IDE when I pressed the mouseUp button on the first
>card. If I click on the checkbox to uncheck, the error message
>appears for the next checkbox that is checked. If you have any other
>ideas, please feel free to suggest them!
>
>Charles Szasz
><a href="x-msg://31/user/SendEmail.jtp?type=node&amp;node=3004073&amp;i=0" target="_top" rel="nofollow">[hidden email]
>
Craig meant me thinks that your inner if should be

if the hilite of button b of card y = "true" then
   send mouseUp to button b of card y
end if

instead of

if the hilite of button b of card y = "true" then send mouseUp to
button b of card y

to avoid compilation ambiguity.

Anyway, your script may fail if your mouseup function does sth that
refers to the buttons on the other card, which are not present on the
current card and it does not make full reference to them but only
uses short names.

Robert
_______________________________________________
use-revolution mailing list
<a href="x-msg://31/user/SendEmail.jtp?type=node&amp;node=3004073&amp;i=1" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004073.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

dunbarxx
In reply to this post by charles61
I made a small stack with three cards.

On the first card I placed a button with your script. On all cards I placed
a checkBox button with a mouseUp handler in it.

I ran the handler from the first card, and got results from the handlers on
the other cards.

In a message dated 10/20/10 11:21:45 AM, [hidden email] writes:


>
> Robert,
>
> I tried your suggestion. But I get the same results: the checkboxes
> received the message on the first card but the checkboxes on the second card did
> not receive the mouseUp message.
>
> Charles Szasz
> [hidden email]
>
>
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
This weird! The script editor shows that the checkboxes on the second card are being examined in the repeat loop but the checkboxes that are checked are not receiving the mouseUp command. This is also supported that the checkboxes are not showing the fields that are not hidden. 

So, I don't know what the difference is between your sample stack and my sample stack to account for the difference results. 

Charles Szasz
[hidden email]




On Oct 20, 2010, at 11:54 AM, dunbarx [via Runtime Revolution] wrote:

I made a small stack with three cards.

On the first card I placed a button with your script. On all cards I placed
a checkBox button with a mouseUp handler in it.

I ran the handler from the first card, and got results from the handlers on
the other cards.

In a message dated 10/20/10 11:21:45 AM, <a href="x-msg://45/user/SendEmail.jtp?type=node&amp;node=3004159&amp;i=0" target="_top" rel="nofollow">[hidden email] writes:


>
> Robert,
>
> I tried your suggestion. But I get the same results: the checkboxes
> received the message on the first card but the checkboxes on the second card did
> not receive the mouseUp message.
>
> Charles Szasz
> <a href="x-msg://45/user/SendEmail.jtp?type=node&amp;node=3004159&amp;i=1" target="_top" rel="nofollow">[hidden email]
>
>
_______________________________________________
use-revolution mailing list
<a href="x-msg://45/user/SendEmail.jtp?type=node&amp;node=3004159&amp;i=2" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004159.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

mwieder
In reply to this post by charles61
charles61-

Wednesday, October 20, 2010, 7:02:51 AM, you wrote:

> I checked the fields and script in this sample stack and cannot find
> anything incorrect. So, I have to think there is a problem in my button
> script below.

There's nothing wrong with this script. The error is probably in the
mouseup handler for the checkboxes. Since you didn't post that, it's
hard to say any more.

--
-Mark Wieder
 [hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
--
 Mark Wieder
 ahsoftware@gmail.com
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

Klaus on-rev
In reply to this post by charles61
Hi Charles,

> Robert,
>
> I tried your suggestion. But I get the same results: the checkboxes received the message on the first card but the checkboxes on the second card did not receive the mouseUp message.
>
> Charles Szasz
> [hidden email]

your script is OK!
But check Roberts answer, that is what's going on on your side!

>> ...
>> Anyway, your script may fail if your mouseup function does sth that
>> refers to the buttons on the other card, which are not present on the
>> current card and it does not make full reference to them but only
>> uses short names.

To avoid this and other traps when sending "mouseup" to object on other cards you coul do this and
since there is no "defaultCard" (like "defaultstack") that we can set, we have to go to all the cards to
avoid this above mentioned phenomenon!

on mouseUp
 ## We want to return to this card after the script has finished!
 put the num of this cd into tStartCard
 lock screen
  repeat with y = 1 to the number of cards
 
  ## We actually have to GO to the cards but to avoid unnecessary
  ## PRE/OPENCARD messages we have to:
 lock messages
 go cd y
 unlock messages
     repeat with b= 1 to the number of buttons
        if the style of button b  = "checkbox" then
           if the hilite of button b  = "true" then
               send "mouseUp" to button b
           end if
       end if
     end repeat
end repeat

## Go back
 lock messages
 go cd tStartCard
 unlock messages
 unlock screen
end mouseUp

>>
>> Robert

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61


Charles Szasz
[hidden email]


Klaus,

Thanks for your suggestion! I will try it. Thanks again!

On Oct 20, 2010, at 12:05 PM, Klaus on-rev [via Runtime Revolution] wrote:

Hi Charles,

> Robert,
>
> I tried your suggestion. But I get the same results: the checkboxes received the message on the first card but the checkboxes on the second card did not receive the mouseUp message.
>
> Charles Szasz
> <a href="x-msg://51/user/SendEmail.jtp?type=node&amp;node=3004174&amp;i=0" target="_top" rel="nofollow">[hidden email]

your script is OK!
But check Roberts answer, that is what's going on on your side!

>> ...
>> Anyway, your script may fail if your mouseup function does sth that
>> refers to the buttons on the other card, which are not present on the
>> current card and it does not make full reference to them but only
>> uses short names.

To avoid this and other traps when sending "mouseup" to object on other cards you coul do this and
since there is no "defaultCard" (like "defaultstack") that we can set, we have to go to all the cards to
avoid this above mentioned phenomenon!

on mouseUp
 ## We want to return to this card after the script has finished!
 put the num of this cd into tStartCard
 lock screen
  repeat with y = 1 to the number of cards
 
  ## We actually have to GO to the cards but to avoid unnecessary
  ## PRE/OPENCARD messages we have to:
 lock messages
 go cd y
 unlock messages
     repeat with b= 1 to the number of buttons
        if the style of button b  = "checkbox" then
           if the hilite of button b  = "true" then
               send "mouseUp" to button b
           end if
       end if
     end repeat
end repeat

## Go back
 lock messages
 go cd tStartCard
 unlock messages
 unlock screen
end mouseUp

>>
>> Robert

Best

Klaus

--
Klaus Major
http://www.major-k.de
<a href="x-msg://51/user/SendEmail.jtp?type=node&amp;node=3004174&amp;i=1" target="_top" rel="nofollow">[hidden email]

_______________________________________________
use-revolution mailing list
<a href="x-msg://51/user/SendEmail.jtp?type=node&amp;node=3004174&amp;i=2" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004174.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

Robert Brenstein
In reply to this post by Klaus on-rev
On 20.10.10 at 18:04 +0200 Klaus on-rev apparently wrote:

>  >> Anyway, your script may fail if your mouseup function does sth that
>>>  refers to the buttons on the other card, which are not present on the
>>>  current card and it does not make full reference to them but only
>>>  uses short names.
>
>To avoid this and other traps when sending "mouseup" to object on
>other cards you coul do this and
>since there is no "defaultCard" (like "defaultstack") that we can
>set, we have to go to all the cards to
>avoid this above mentioned phenomenon!

If one uses full reference in the called script (that is script in
btn b of cd y refers to itself as btn b of cd y) then going to that
card before running that script is not needed.

Robert
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
In reply to this post by Klaus on-rev
Klaus,

Your script worked!  What changes do I have to make if I wanted to use this script to send a mouseUp to checkboxes on marked cards?  I did not use marked cards in my sample stack.

Charles Szasz
[hidden email]




On Oct 20, 2010, at 12:05 PM, Klaus on-rev [via Runtime Revolution] wrote:

Hi Charles,

> Robert,
>
> I tried your suggestion. But I get the same results: the checkboxes received the message on the first card but the checkboxes on the second card did not receive the mouseUp message.
>
> Charles Szasz
> <a href="x-msg://54/user/SendEmail.jtp?type=node&amp;node=3004174&amp;i=0" target="_top" rel="nofollow">[hidden email]

your script is OK!
But check Roberts answer, that is what's going on on your side!

>> ...
>> Anyway, your script may fail if your mouseup function does sth that
>> refers to the buttons on the other card, which are not present on the
>> current card and it does not make full reference to them but only
>> uses short names.

To avoid this and other traps when sending "mouseup" to object on other cards you coul do this and
since there is no "defaultCard" (like "defaultstack") that we can set, we have to go to all the cards to
avoid this above mentioned phenomenon!

on mouseUp
 ## We want to return to this card after the script has finished!
 put the num of this cd into tStartCard
 lock screen
  repeat with y = 1 to the number of cards
 
  ## We actually have to GO to the cards but to avoid unnecessary
  ## PRE/OPENCARD messages we have to:
 lock messages
 go cd y
 unlock messages
     repeat with b= 1 to the number of buttons
        if the style of button b  = "checkbox" then
           if the hilite of button b  = "true" then
               send "mouseUp" to button b
           end if
       end if
     end repeat
end repeat

## Go back
 lock messages
 go cd tStartCard
 unlock messages
 unlock screen
end mouseUp

>>
>> Robert

Best

Klaus

--
Klaus Major
http://www.major-k.de
<a href="x-msg://54/user/SendEmail.jtp?type=node&amp;node=3004174&amp;i=1" target="_top" rel="nofollow">[hidden email]

_______________________________________________
use-revolution mailing list
<a href="x-msg://54/user/SendEmail.jtp?type=node&amp;node=3004174&amp;i=2" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004174.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

Klaus on-rev
Hi Charles,

> Klaus,
>
> Your script worked!  

Go figure :-)

> What changes do I have to make if I wanted to use this script to send a mouseUp to checkboxes on marked cards?  I did not use marked cards in my sample stack.

See below...

> Charles Szasz
> [hidden email]
>
>
> ...
>>
>>
> on mouseUp
> ## We want to return to this card after the script has finished!
> put the num of this cd into tStartCard
> lock screen
>  repeat with y = 1 to the number of cards

  if the mark of cd y <> true then
   next repeat
  end if

>
>  ## We actually have to GO to the cards but to avoid unnecessary
>  ## PRE/OPENCARD messages we have to:
> lock messages
> go cd y
> unlock messages
>     repeat with b= 1 to the number of buttons
>        if the style of button b  = "checkbox" then
>           if the hilite of button b  = "true" then
>               send "mouseUp" to button b
>           end if
>       end if
>     end repeat
> end repeat
>
> ## Go back
> lock messages
> go cd tStartCard
> unlock messages
> unlock screen
> end mouseUp

Best

Klaus
--
Klaus Major
http://www.major-k.de
[hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
Klaus,

Thanks!

Charles Szasz
[hidden email]




On Oct 20, 2010, at 12:35 PM, Klaus on-rev [via Runtime Revolution] wrote:

Hi Charles,

> Klaus,
>
> Your script worked!  

Go figure :-)

> What changes do I have to make if I wanted to use this script to send a mouseUp to checkboxes on marked cards?  I did not use marked cards in my sample stack.

See below...

> Charles Szasz
> <a href="x-msg://64/user/SendEmail.jtp?type=node&amp;node=3004211&amp;i=0" target="_top" rel="nofollow">[hidden email]
>
>
> ...
>>
>>
> on mouseUp
> ## We want to return to this card after the script has finished!
> put the num of this cd into tStartCard
> lock screen
>  repeat with y = 1 to the number of cards
  if the mark of cd y <> true then
   next repeat
  end if

>
>  ## We actually have to GO to the cards but to avoid unnecessary
>  ## PRE/OPENCARD messages we have to:
> lock messages
> go cd y
> unlock messages
>     repeat with b= 1 to the number of buttons
>        if the style of button b  = "checkbox" then
>           if the hilite of button b  = "true" then
>               send "mouseUp" to button b
>           end if
>       end if
>     end repeat
> end repeat
>
> ## Go back
> lock messages
> go cd tStartCard
> unlock messages
> unlock screen
> end mouseUp
Best

Klaus
--
Klaus Major
http://www.major-k.de
<a href="x-msg://64/user/SendEmail.jtp?type=node&amp;node=3004211&amp;i=1" target="_top" rel="nofollow">[hidden email]

_______________________________________________
use-revolution mailing list
<a href="x-msg://64/user/SendEmail.jtp?type=node&amp;node=3004211&amp;i=2" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004211.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

Klaus on-rev
In reply to this post by Robert Brenstein
Hi Robert,

> On 20.10.10 at 18:04 +0200 Klaus on-rev apparently wrote:
>> >> Anyway, your script may fail if your mouseup function does sth that
>>>> refers to the buttons on the other card, which are not present on the
>>>> current card and it does not make full reference to them but only
>>>> uses short names.
>>
>> To avoid this and other traps when sending "mouseup" to object on other cards you coul do this and
>> since there is no "defaultCard" (like "defaultstack") that we can set, we have to go to all the cards to
>> avoid this above mentioned phenomenon!
>
> If one uses full reference in the called script (that is script in btn b of cd y refers to itself as btn b of cd y) then going to that card before running that script is not needed.

yep, but if one doesn't, it is ;-)

> Robert

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
In reply to this post by Robert Brenstein
Robert,

I understand your previous e-mail about using custom handlers.  I have never used this concept before. But I am not following you when you sent the following:

f one uses full reference in the called script (that is script in 
btn b of cd y refers to itself as btn b of cd y) then going to that 
card before running that script is not needed. 

While the script that Klaus posted works, I still want to fully understand your comments above. Could you elaborate further?

Charles Szasz
[hidden email]




On Oct 20, 2010, at 12:30 PM, Robert Brenstein [via Runtime Revolution] wrote:

On 20.10.10 at 18:04 +0200 Klaus on-rev apparently wrote:

>  >> Anyway, your script may fail if your mouseup function does sth that
>>>  refers to the buttons on the other card, which are not present on the
>>>  current card and it does not make full reference to them but only
>>>  uses short names.
>
>To avoid this and other traps when sending "mouseup" to object on
>other cards you coul do this and
>since there is no "defaultCard" (like "defaultstack") that we can
>set, we have to go to all the cards to
>avoid this above mentioned phenomenon!
If one uses full reference in the called script (that is script in
btn b of cd y refers to itself as btn b of cd y) then going to that
card before running that script is not needed.

Robert
_______________________________________________
use-revolution mailing list
<a href="x-msg://61/user/SendEmail.jtp?type=node&amp;node=3004205&amp;i=0" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004205.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

Robert Brenstein
On 20.10.10 at 09:47 -0700 charles61 apparently wrote:

>Robert,
>
>I understand your previous e-mail about using custom handlers.  I
>have never used this concept before. But I am not following you when
>you sent the following:
>
>f one uses full reference in the called script (that is script in
>btn b of cd y refers to itself as btn b of cd y) then going to that
>card before running that script is not needed.
>
>While the script that Klaus posted works, I still want to fully
>understand your comments above. Could you elaborate further?
>
>Charles Szasz
>[hidden email]
>

For example, a btn on cd 1 does

   send dostuff to btn 3 of cd 2

handler dostuff in btn 3 on cd 2 has

   show fld 1

This will fail unless you are on this card (using go in btn on cd 1
as Klaus suggested). However,

   show fld 1 of cd 2

will work with the send without having to go. This will work just
fine if executed by clicking btn 3 on cd 2, if its mouseUp is

mouseUp
   dostuff
end mouseUp

Having "of cd 2" in the object reference is what I meant by full
reference. Of course, normally, one would use names of objects.

Robert
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

charles61
Robert,

Thanks for your explanation and your time!

Charles Szasz
[hidden email]




On Oct 20, 2010, at 1:01 PM, Robert Brenstein [via Runtime Revolution] wrote:

On 20.10.10 at 09:47 -0700 charles61 apparently wrote:

>Robert,
>
>I understand your previous e-mail about using custom handlers.  I
>have never used this concept before. But I am not following you when
>you sent the following:
>
>f one uses full reference in the called script (that is script in
>btn b of cd y refers to itself as btn b of cd y) then going to that
>card before running that script is not needed.
>
>While the script that Klaus posted works, I still want to fully
>understand your comments above. Could you elaborate further?
>
>Charles Szasz
><a href="x-msg://73/user/SendEmail.jtp?type=node&amp;node=3004246&amp;i=0" target="_top" rel="nofollow">[hidden email]
>
For example, a btn on cd 1 does

   send dostuff to btn 3 of cd 2

handler dostuff in btn 3 on cd 2 has

   show fld 1

This will fail unless you are on this card (using go in btn on cd 1
as Klaus suggested). However,

   show fld 1 of cd 2

will work with the send without having to go. This will work just
fine if executed by clicking btn 3 on cd 2, if its mouseUp is

mouseUp
   dostuff
end mouseUp

Having "of cd 2" in the object reference is what I meant by full
reference. Of course, normally, one would use names of objects.

Robert
_______________________________________________
use-revolution mailing list
<a href="x-msg://73/user/SendEmail.jtp?type=node&amp;node=3004246&amp;i=1" target="_top" rel="nofollow">[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution



View message @ http://runtime-revolution.278305.n4.nabble.com/Sending-mouseup-to-checkboxes-on-different-card-tp3003921p3004246.html
To unsubscribe from Sending mouseup to checkboxes on different card, click here.


Reply | Threaded
Open this post in threaded view
|

Re: Sending mouseup to checkboxes on different card

slylabs13
In reply to this post by charles61
The rub lies in the fact that Revolution (WHOOPS! Sorry RunRev (WHOOP! Sorry LiveCode!)) allows short references to objects. If you refer to "button 1", LiveCode resolves this internally to mean "button 1 of [the background the button belongs to if any of] the card I am currently looking at of the stack that card is in.

So when you call MouseUp for a button on another card, the card you are STILL IN is the one you are looking at, NOT the card the button is on which contains the mouseUp handler. By actually GOING to that card first (one method) "the card you are looking at" now means the one the button you are sending mouseUp to is on, because you just went there, and now the card and all it's objects are loaded into memory.

Now something to consider when writing scripts in buttons or any kind of card object like fields and menus and such, is that the scripts in the objects should not do anything that refers to objects not on the current card. Some would disagree with me, but I think this is a good practice in order to keep your code readable. Instead, handlers like that should be in card, background or stack scripts because of the kinds of issues you encountered.

For instance, if I have a script that modifies objects on each card, I would put that script in the stack script, because all the cards are in the stack. I could get the long names of all the cards of this stack, and then loop through each line to build the long names of all the objects I am referencing, but as noted above, it is often easier to lock the screen and then actually go to each card (as noted above). Also, I try to avoid doing any coding in buttons and fields and such that actually change anything. I call functions and commands in the card, background or stack scripts, depending on the scope of the command or function.

It's nice to have your code modular, so that it is contained in each object that calls it, but practically it gets to be a real pain later on when you have LOTS of handlers in LOTS of objects. Keeping track of where it all is becomes unmanageable in a hurry.

One more thing (and pardon my lengthy reply) but often people with past experience in Hypercard continue to use the method of having one card per bit of information to store their data. Just know that LiveCode is not really optimized for this, as many Hypercard importers have discovered. It's probably better to store your data in a custom property and design your cards as forms instead.

Just my 2¢

Bob


On Oct 20, 2010, at 9:47 AM, charles61 wrote:

>
> Robert,
>
> I understand your previous e-mail about using custom handlers.  I have never used this concept before. But I am not following you when you sent the following:
>
> f one uses full reference in the called script (that is script in
> btn b of cd y refers to itself as btn b of cd y) then going to that
> card before running that script is not needed.
>
> While the script that Klaus posted works, I still want to fully understand your comments above. Could you elaborate further?
>
> Charles Szasz
> [hidden email]
>

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
12