My first suspicion is that this_Card and/or this_Stack  contains an invalid 
value. I’d bet that if you inserted the line:


put the long ID of card this_Card of stack this_Stack


...before your "set the scroll…" lines, you’d get the same error, because 
you’re not specifying a valid object. The button works because it’s operating 
on the current card of the stack.

Look carefully at your variables. this_Stack should contain a stack name, or a 
path to a stack; this_Card should contain a card number or card name. If you 
are putting values into these variables by using "the name of…", then use "the 
short name of…" instead, because in the first instance, you’re getting the 
string:

stack "myStack"

...when what you need is:

myStack


t


On Jul 10, 2012, at 1:34 PM, Jessica McBeck wrote:

> Hi all,
> 
> I am attempting to set the hScroll and vScroll of a group from a card's
> script. This card does not contain the group. Here's the script:
> 
> set the vScroll of group "ScrollingGroup" of card this_Card of stack
> this_Stack to y
> set the hScroll of group "ScrollingGroup" of card this_Card of stack
> this_Stack to x
> 
> But during runtime livecode returns the error "Can't set property".
> However, when I place a button on this_Card with the script
> 
> on mouseDown
>   put the vScroll of group "ScrollingGroup" into v
>   add 10 to v
>   set the vScroll of group "ScrollingGroup" to v
> end mouseDown
> 
> the group scrolls as expected. So then I tried calling a "send" command to
> the button from the card script with the necessary scroll values and got
> the same "Can't set property" error message. Here's that code:
> 
> In the card this_Card script:
> 
> send "scrollMe" && x_b & comma && y_b to button "set scroll"
> 
> In the button "set scroll" script:
> 
> on scrollMe scrollX, scrollY
>   set the vScroll of group "ScrollingGroup" to scrollX
>   set the hScroll of group "ScrollingGroup" to scrollY
> end scrollMe
> 
> I imagine the problem is related to the linear flow of the message path,
> but cannot think of a clever work-around. Any suggestions are greatly
> appreciated!
> 
> Thanks,
> Jess
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to