"Can't set property" returned upon trying to set the hScroll, vScroll of a group from card script

Peter M. Brigham pmbrig at gmail.com
Tue Jul 10 22:14:08 EDT 2012


Maybe try using the term "background" or "bkgnd" instead of "group"? When a group xxx exists in a stack but is not placed on card yyy, the "group xxx of card yyy" is not found but "bkGnd xxx of card yyy" will work. I think.

-- Peter

Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig

On Jul 10, 2012, at 2: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 at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list