Button vs. Message box scripts

Wilhelm Sanke sanke at hrz.uni-kassel.de
Mon Mar 31 16:48:01 EST 2003


On Sun, 30 Mar 2003
"Jeanne A. E. DeVoto" <jeanne at runrev.com> wrote:


> At 6:54 AM -0800 3/28/03, Jim Hurley wrote:
>
> >On mouseUp
> >revrotatepoly graphic "MyPoly", 90
> >end mouseUp
> >
> >return an error: "Chunk source is not a container."
>
>
> The problem here is that revRotatePoly needs an expression that evaluates
> to a graphic reference, not a graphic reference itself. (This is for
> complicated reasons having to do with the fact that revRotatePoly is a
> Transcript library routine.) This will work:
>
>   revRotatePoly the long ID of graphic "MyPoly",90
>
> --
> Jeanne A. E. DeVoto ~ jeanne at runrev.com
> Runtime Revolution Limited - Software at the Speed of Thought
>
The reasons may be even more complicated and are possibly *not* related
to the fact that the script is located in the "revlibrary" stack. If you
put the two parts of the script of "revRotatePoly" ("on revRotatePoly
pGraphic, pAngle" and "function revPoints pGraphic")  into a button or
card script of your own stack, you have the same problems. You can test
this in a situation where the revLibrary stack is not present, as for
instance when you put the two scripts into a Metacard stack.

It seems to be a problem of how the Metacard engine - as a basis for
Revolution - handles the script.

Adding "the long ID of" to the respective parts of the script doesn't
help. Neither is this problem restricted to graphics.

If you create a handler

"on Buttoncolor pButton
    put the backcolor of the long ID  of pButton
end ButtonColor"

you still have to use "the long ID of" in your calling script or in the
message box.

What is really puzzling is why the "revRotatePoly" script works from the
message box which the "buttoncolor pButton" does not when you omit "the
long ID of" in the above basic handler.


Regards,

Wilhelm Sanke






More information about the use-livecode mailing list